{
strSQl = @"select * from User";
DfwSqlDataAdapter daListData;
DataSet dsListData = new DataSet();
DataTable dtListData = new DataTable();
try
{
using (SqlConnection conn = DfwSql.GetOpenConnection())
{
using (SqlTransaction trs = conn.BeginTransaction(IsolationLevel.Serializable))
{
dtListData.TableName = "SectName";
daListData = new DfwSqlDataAdapter(strSQl , conn, trs);
daListData.Fill(dtListData);
trs.Commit();
}
}
}
catch (Exception)
{
throw;
}
dsListData.Tables.Add(dtListData);
return dsListData;
}
public static SqlConnection GetOpenConnection(bool useAdmin, string referenceDB, int connectTimeout)
{
SqlConnectionStringBuilder bldr = new SqlConnectionStringBuilder();
bldr.DataSource = SQLSERVER; // @"."SQLSERVER";
bldr.InitialCatalog = NORTHWIND;
bldr.UserID = ALEXUSLI
bldr.Password = 123456
bldr.AsynchronousProcessing = true;
bldr.MultipleActiveResultSets = false;
bldr.Pooling = true;
bldr.ConnectTimeout = 15;
bldr.ContextConnection = false;
string connectionString = bldr.ConnectionString;
SqlConnection con = new SqlConnection(connectionString);
con.Open();
return con;
}