这是我这网上找的代码,运行是就报标题的错了,错在哪?
string sql = "SELECT dbimpression, dbctr, dbclick FROM t_inputdb where mediaid='sina'";
string DBConfig_sql =@"Data Source=(local);Initial Catalog = adoa;uid=sa;Password=ebooom";
DataSet ds = new DataSet();
SqlConnection sqlCon = new SqlConnection(DBConfig_sql);
SqlCommand sqlCmd = new SqlCommand(sql, sqlCon);
SqlDataAdapter sqlAd = new SqlDataAdapter();
sqlAd.SelectCommand = sqlCmd;
sqlAd.Fill(ds, "sql");
CrystalReportSource1.ReportDocument.Load(Server.MapPath("CrystalReport11.rpt"));
//注意此处必需指明Dataset中的表的名称,否则会提示“您请求的报表需要更多信息.”
CrystalReportSource1.ReportDocument.SetDataSource(ds.Tables["sql"]);
//{?}中的参数可以不用赋值,即使赋了值也不起作用。
// CrystalReportSource1.ReportDocument.ParameterFields["Parm"].CurrentValues.AddValue("1234567");
CrystalReportSource1.ReportDocument.ParameterFields["Title"].CurrentValues.AddValue("这时推模式的报表样例!");
CrystalReportSource1.DataBind();
CrystalReportViewer1.ReportSource = CrystalReportSource1;
CrystalReportViewer1.DataBind();
string sql = "SELECT dbimpression, dbctr, dbclick FROM t_inputdb where mediaid='sina'";
string DBConfig_sql =@"Data Source=(local);Initial Catalog = adoa;uid=sa;Password=ebooom";
DataSet ds = new DataSet();
SqlConnection sqlCon = new SqlConnection(DBConfig_sql);
SqlCommand sqlCmd = new SqlCommand(sql, sqlCon);
SqlDataAdapter sqlAd = new SqlDataAdapter();
sqlAd.SelectCommand = sqlCmd;
sqlAd.Fill(ds, "sql");
CrystalReportSource1.ReportDocument.Load(Server.MapPath("CrystalReport11.rpt"));
//注意此处必需指明Dataset中的表的名称,否则会提示“您请求的报表需要更多信息.”
CrystalReportSource1.ReportDocument.SetDataSource(ds.Tables["sql"]);
//{?}中的参数可以不用赋值,即使赋了值也不起作用。
// CrystalReportSource1.ReportDocument.ParameterFields["Parm"].CurrentValues.AddValue("1234567");
CrystalReportSource1.ReportDocument.ParameterFields["Title"].CurrentValues.AddValue("这时推模式的报表样例!");
CrystalReportSource1.DataBind();
CrystalReportViewer1.ReportSource = CrystalReportSource1;
CrystalReportViewer1.DataBind();
解决方案 »
- 求asp 连接Oracle9的最佳方法!
- vs2008双语网站问题
- web.config里面的一个错误
- UML基础作业---上海一家公司的面试题,看看谁回答的比较好
- 问个ASP.NET 2.0 空间提供商的问题. 想买个小空间,注册个WWW.###.CN的域名;放自己做的个人主页.
- 我有一个2005的asp.net网站发布不了,发布后文件夹是空的,但是生成是可以生成的
- 无法更新;当前被锁定。请教是怎么回事?
- 动态生成图片 并下载 在线等
- sql还是读不出数据?菜鸟问题
- 关于 Math.NET Numerics 多元线性回归
- 高分求解:又是编码问题,让我头痛了
- 如何给所有textbox加上onpropertychange()事件
要先建个连接,把列加在报表上啊