利用xsd作为crystal的数据源,但是为什么显示不出来数据库中的数据?
将报表数据源绑定到xsd文件,想要显示xsd中包含的一张表中的数据,但是无法显示,代码如下:
//Show the Data in the DataGrid.
string strCon="server=j-xiao;uid=sa;pwd=sa;database=northwind";
string strCommand="select * from customers";
System.Data.SqlClient.SqlConnection CN=new SqlConnection(strCon);
System.Data.DataSet dsRpt=new System.Data.DataSet();
System.Data.SqlClient.SqlDataAdapter adpRpt;
adpRpt=new SqlDataAdapter(strCommand,CN);
adpRpt.Fill(dsRpt,"Customers");
this.dgGrid.DataSource=dsRpt.Tables[0].DefaultView;
//Print the Report
ReportFile.Report1 oRpt=new ReportFile.Report1();
oRpt.SetDataSource(dsRpt.Tables[0]);
this.rptView.ReportSource=oRpt;
请教高手........