Crystal Report显示无数据

时间:2017-05-02 11:18:26

标签: c# mysql visual-studio crystal-reports

我有一个连接到MySQL的c#应用程序我使用Crystal Report,问题是当我点击按钮时它收到空数据,如下图所示:

enter image description here

这是我的代码:

 MySqlDataAdapter MyDA = new MySqlDataAdapter();
            MyDA.SelectCommand = new MySqlCommand("SELECT * from staff", con);
            DataTable table = new DataTable();
            MyDA.Fill(table);
            ReportDocument rpt = new ReportDocument();
            MyDataSet ds = new MyDataSet();
            ds.Tables[0].Merge(table);
            rpt.Load(@"C:\Users\Hoger\documents\visual studio2012\Projects\PHC\PHC\cr.rpt");
            rpt.SetDataSource(ds);
            crystalReportViewer1.ReportSource = rpt;

这是rpt:enter image description here

由于

0 个答案:

没有答案
相关问题