数据库是sqlite,代码如下,什么推模式拉模式的不懂呀。。
SQLiteConnection conn = new SQLiteConnection("Data Source=equipment.db");
conn.Open();
SQLiteCommand comm = new SQLiteCommand("select eqName,model,danwei,count,price,total from storeA", conn);
SQLiteDataAdapter adapter = new SQLiteDataAdapter(comm);
DataSet set = new DataSet();
adapter.Fill(set,"storeA");
ReportDocument myReport = new ReportDocument();
string reportPath = Application.StartupPath + "\CrystalReport1.rpt";
myReport.Load(reportPath);
//绑定数据集
myReport.SetDataSource(set.Tables[0].DefaultView);
cReportViewer1.ReportSource = myReport;
cReportViewer1.RefreshReport();
conn.Close();