【SqlDataAdapter.Update()】关于使用DataSet更新
/// <summary>
/// 增加DataSet
/// </summary>
/// <param name="ds">Oracle DataSet</param>
/// <param name="tableName">tableName</param>
public int AddDataSet(DataSet ds1, string tableName)
{
string sql = "select * from " + tableName;
int judge= 0;
using (SqlConnection connection = new SqlConnection(connectionString))
{
SqlDataAdapter da;
try
{
DataSet ds = new DataSet();
connection.Open();
da = new SqlDataAdapter(sql, connection);
SqlCommandBuilder sb = new SqlCommandBuilder(da);
da.InsertCommand = sb.GetInsertCommand();
da.Fill(ds, "ds");
// 合并Oracle-Sql DataSet
ds.Merge(ds1);
judge = da.Update(ds,"ds");
ds.AcceptChanges();