62,046
社区成员
发帖
与我相关
我的任务
分享
string sql = "select * from "+strTableName;
OleDbConnection cn = new OleDbConnection(strcn);
OleDbDataAdapter ada = new OleDbDataAdapter(sql,cn);
ada.Fill(ds,"ab");
OleDbCommandBuilder cb = new OleDbCommandBuilder(ada);
foreach(DataRow r in ds.Tables[0].Rows)
{
ds.Tables[1].Rows.Add(r.ItemArray);
}
DelTable(strTableName,strcn);
try
{
// lock(this) //处理并发情况(分布式情况
// {
ada.Update(ds.Tables[1]);
// }
}
catch(Exception err)
{
throw new Exception(err.ToString());
}
finally
{
cn.Close();
ds.Dispose();
}
return ds;