public DataSet GetShopNameFromBussinessTable()
        {
            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;
        }

 

 

 

posted on 2008-12-24 19:06  AlexusLi  阅读(238)  评论(0编辑  收藏  举报