首页上一页 1 下一页尾页 1 条记录 1/1页
关于推入模式的ADO.NET数据集报表
发表在ASP.NET图书答疑
2011-08-08
是否精华
是
否
版块置顶:
是
否
请问 我在报表里 用ADO。NET数据集添加了数据源,添加过后 报表无数据绑定 这正常吗?
string Connection = "Data Source=jdrea3;Initial Catalog=gdjdrea;Persist Security Info=True;User ID=sa;password=510406";
SqlConnection CONN = new SqlConnection(Connection);
CONN.Open();
string sql = "select * from mcar";
SqlDataAdapter myadapter = new SqlDataAdapter(sql, CONN);
DataSet ds = new DataSet();
myadapter.Fill(ds,"mcar");
ReportDocument McarReport = new ReportDocument();
McarReport.Load(Server.MapPath("CrMcarAdo.rpt"));
McarReport.SetDataSource(ds);
this.CrystalReportViewer2.ReportSource = McarReport;
我写的这段代码是照书上写的,但最后报表也无内容,不清楚什么原因
string Connection = "Data Source=jdrea3;Initial Catalog=gdjdrea;Persist Security Info=True;User ID=sa;password=510406";
SqlConnection CONN = new SqlConnection(Connection);
CONN.Open();
string sql = "select * from mcar";
SqlDataAdapter myadapter = new SqlDataAdapter(sql, CONN);
DataSet ds = new DataSet();
myadapter.Fill(ds,"mcar");
ReportDocument McarReport = new ReportDocument();
McarReport.Load(Server.MapPath("CrMcarAdo.rpt"));
McarReport.SetDataSource(ds);
this.CrystalReportViewer2.ReportSource = McarReport;
我写的这段代码是照书上写的,但最后报表也无内容,不清楚什么原因