public string UpdateDataAdapter(DataTable tab)
{
if (sda == null) return "DataAdapter还未初始化,请调用GetAdapterTable()方法进行促使化!";
//if (IsHaveTran)
//{
// sda.SelectCommand.Transaction = sqltran;
//}
sda.SelectCommand.Transaction = sqltran;
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
try
{
sda.Update(tab);
m_dbLog.Trans = sqltran;
m_dbLog.Conn = SqlConnection;
DbUpdateLogApi api = DbUpdateLogApiFacotry.GetInterfaceInfo(m_dbLog.FunctionType, m_dbLog);
//string strmessage = api.Execute();
//if (!string.IsNullOrEmpty(strmessage))
//{
// RollbackTransaction();
// Close();
// return strmessage;
//} if (_autoCommit)
{
sqltran.Commit();
_autoCommit = false;
}
return string.Empty; }
catch (Exception e)
{
RollbackTransaction();
Close();
return e.Message;
}
finally
{
scb.Dispose();
}
}