0
這是我的代碼,運行代碼時出現錯誤,需要一些幫助!C#windows水晶報表,如何在水晶報表中編程顯示數據表
private void Form2_Load(object sender, EventArgs e)
{
string sql = "SELECT * FROM Worker ";
SqlConnection connection = new SqlConnection(connectonString);
SqlDataAdapter da = new SqlDataAdapter(sql, connection);
DataTable dt = new DataTable();
da.Fill(dt);
CrystalReport1 cr = new CrystalReport1();
cr.SetDataSource(dt);
crystalReportViewer1.ReportSource = cr;
crystalReportViewer1.Refresh();
}
重複的問題: [如何綁定水晶報表手動創建數據集(HTTP:// stackoverflow.com/questions/8341272/how-to-bind-crystal-report-to-manually-created-dataset) –