private void Form1_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=10.100.100.5;Initial Catalog=cldz;User ID=proc4;Password=77cc88");
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select top 100 * from ZZZPJ", con);
DataSet ds = new DataSet();
da.Fill(ds, "ZZZPJ");
string reportPath = Application.StartupPath + @"\CrystalReport1.rpt";
ReportDocument rd = new ReportDocument();
rd.Load(reportPath);
rd.SetDataSource(ds.Tables[0].DefaultView);
this.crystalReportViewer1.ReportSource = rd;
}
{
SqlConnection con = new SqlConnection("Data Source=10.100.100.5;Initial Catalog=cldz;User ID=proc4;Password=77cc88");
con.Open();
SqlDataAdapter da = new SqlDataAdapter("select top 100 * from ZZZPJ", con);
DataSet ds = new DataSet();
da.Fill(ds, "ZZZPJ");
string reportPath = Application.StartupPath + @"\CrystalReport1.rpt";
ReportDocument rd = new ReportDocument();
rd.Load(reportPath);
rd.SetDataSource(ds.Tables[0].DefaultView);
this.crystalReportViewer1.ReportSource = rd;
}