水晶报表Push模式的疑问,请指教!

stevenzj2 2006-06-19 10:30:10

我从网上摘抄的部份代码如下:
Push模式:

myReport ReportDoc = new myReport();
string strProvider = "Server=(local);DataBase=starage;UID=sa;PWD=sa";
SqlConnection MyConn = new SqlConnection(strProvider);
MyConn.Open();
string strSel = "Select * from test";
SqlDataAdapter MyAdapter = new SqlDataAdapter(strSel,MyConn);
DataSet1 ds = new DataSet1();
MyAdapter.Fill(ds,"test");
ReportDoc.SetDataSource(ds);
Crv.ReportSource = ReportDoc;

在没有myReport ReportDoc = new myReport();这句话,还是出现出现登录失败;
myReport ReportDoc = new myReport();中的myreport类是怎么设计的?
为什么没有这句话,还是出现登录失败问题?


...全文
301 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
stevenzj2 2006-06-21
  • 打赏
  • 举报
回复
非常感谢xwdd129(因为有你^_^) !
xwdd129 2006-06-20
  • 打赏
  • 举报
回复
这个不是连接字符串的问题,是没找到报表类!

myReport就是报表文件,是你自己开发的那个.rpt文件,它会被作为一个类来对待,在项目中引用就使用myReport ReportDoc = new myReport();来声明!

参见:简要说明一下水晶报表的引用方式
http://blog.csdn.net/xwdd129/archive/2006/03/30/644423.aspx
wangxueyan 2006-06-19
  • 打赏
  • 举报
回复
这样的错误就是你连接字符撤串有问题
("server=.;database=数据库名;uid=sa;pwd=")

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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