public static DataTable UpdateRows(string connectionString, string queryString, string tableName, DataSet ds)
{
using (OleDbConnection conn = new OleDbConnection(connectionString))
{
conn.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter(queryString, conn);
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);
DataTable table1 = new DataTable();
adapter.Fill(table1);
for (int n= 0; n< ds.Tables[0].Rows.Count; n++)
{
DataRow row = table1.NewRow();
for (int m = 0; m < ds.Tables[0].Columns.Count; m++)
{
row[m+1] = ds.Tables[0].Rows[n][m].ToString();
}
table1.Rows.Add(row);
}
C# 将数据批量插入accesss中
最新推荐文章于 2024-08-15 09:15:46 发布