标签:
/// <summary> /// 初始化数据库连接适配器按照strsql进行填充的DataTab /// </summary> public string GetAdapterTable(string strsql, DataTable tab) { if (!IsHaveTran) { BeginTransaction(); _autoCommit = true; } if (sda == null) sda = new SqlDataAdapter(strsql, SqlConnection); else sda.SelectCommand.CommandText = strsql; //if (IsHaveTran) //{ // sda.SelectCommand.Transaction = sqltran; //} sda.SelectCommand.Transaction = sqltran; try { sda.Fill(tab); m_dbLog = new DbUpdateLog(); m_dbLog.UnChangedDT = tab.Copy(); m_dbLog.ExecuteSQL = strsql; m_dbLog.FunctionType = DbUpdateLog.EnumFunctionType.UpdateDataAdapter; m_dbLog.UserInfo_ID = HttpContext.Current.Session["UserID"].ToString(); return string.Empty; } catch (Exception e) { return e.Message; } }
标签:
原文地址:http://www.cnblogs.com/Echo529/p/4544315.html