水晶报表多个表的数据源问题!!!

usxue 2004-06-24 03:45:23
我设计的水晶报表的数据源中有多个表:
假设有table1,table2
this.dataSet1 = new DataSet();
this.sqlSelectcmd = "select table1.*,table2.* from table1,table2 where table1.ID=table2.ID";
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(this.sqlSelectcmd);
this.sqlDataAdapter1.Fill(this.dataSet1);
this.crystalReport1.SetDataSource(this.dataSet1);
this.crystalReportViewer1.ReportSource = this.crystalReport1;
这里的SqlConnection不是本地。

但是问题出现的是:
报表显示的数据中,table1中的数据是可以显示的,但table2中的数据显示的是本地的数据库中的数据。也就是说table1的数据和本地的table2表相联结了。
这两个表都从本地的数据库中加过来的,但数据源的动态的,
两个表的链接参数是:ID,都是完全外部链接。
谢谢,这个问题把我弄的头昏脑胀的,谢谢!
...全文
192 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
李洪喜 2004-09-03
  • 打赏
  • 举报
回复
http://www.dishan.cn/download/1.rar
usxue 2004-06-24
  • 打赏
  • 举报
回复
各位大哥帮帮忙啊,谢谢!
usxue 2004-06-24
  • 打赏
  • 举报
回复
无法连接啊!
:(
李洪喜 2004-06-24
  • 打赏
  • 举报
回复
http://www.dishan.cn/1.rar

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧