日期:2014-05-17 浏览次数:21048 次
ReceiveCrystalReport rpt = new ReceiveCrystalReport();
DataSet ds = new DataSet();
string strConn = "Data Source=192.168.1.1;Initial Catalog=Test;User ID=sa;Password=123456";
SqlConnection conn = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter("Select id,pay_time,type,remark from test", conn);
da.Fill(ds, "test");
rpt.SetDataSource(ds.Tables["test"]);
this.crystalReportViewer1.ReportSource = rpt;