我正在尝试使用 Csharp 语言创建 Crystal Report,我在本网站上找到了如何使用 C# 创建 Crystal Replort 的课程
http://www.codeproject.com/Articles/14029/How-to-Create-a-Crystal-Report-using-C-and-MySQL
但是当我尝试理解代码时,我不理解某些行以及如何将其更新到我的情况
完整的按钮代码
private void button2_Click(object sender, EventArgs e)
{
Mydb mysqlclass = new Mydb();
mysqlclass.conncting();
// here is error under fahad.conncting.createcommand();
MySqlCommand cmd = mysqlclass.connection.CreateCommand();
cmd.CommandText = "SELECT * FROM admin ";
mysqlclass.connection.Open();
MySqlDataAdapter adap = new MySqlDataAdapter(cmd);
MySqlDataReader dataReader = cmd.ExecuteReader();
// Create a Dataset and using DataAdapter to fill it
adap = new MySqlDataAdapter();
adap.SelectCommand = cmd;
CustomerDS custDB = new CustomerDS();
custDB.Clear();
adap.Fill(custDB, "Customers");
// Create a CrystalReport1 object
CrystalReport1 myReport = new CrystalReport1();
// Set the DataSource of the report
myReport.SetDataSource(custDB);
// Set the Report Source to ReportView
crystalReportViewer1.ReportSource = myReport;
}
你能解释一下这意味着什么剂量以及如何根据我的情况改变它吗,谢谢
这是我不明白的
CustomerDS custDB = new CustomerDS();
custDB.Clear();
adap.Fill(custDB, "Customers");