怎么把两个OleDbDataAdapter 合并到一个DataTable
程序代码:
public OleDbDataAdapter FindForMdb(string mdbpath,string sql) { string connstr = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =" + mdbpath; OleDbConnection conn = new OleDbConnection(connstr); return new OleDbDataAdapter(sql, conn); } private void btnFind_Click(object sender, EventArgs e) { string sql = txtFind.Text; int dataCount = GetMDBCount(); OleDbDataAdapter da; System.Data.DataTable dt = new System.Data.DataTable(); for (int i = 1; i < dataCount; i++) { string path = System.Windows.Forms.Application.StartupPath + "\\data" + i.ToString() + ".mdb"; da=FindForMdb(path, sql); da.Fill(dt); } dataGridView1.DataSource = dt; }
for循环这里会出现从多个文件从的查找结果 ,怎么显示到窗体上?