/// <summary>
        /// 不用事务直接执行sql脚本(beta)
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        private static int ExecuteSqlWithGo(String sql)
        {
            int effectedRows = 0;

            SqlCommand cmd = new SqlCommand();

            cmd.Connection = SqlServerConnection.GetConnection();
            try
            {
                //注: 此处以 换行_后面带0到多个空格_再后面是go 来分割字符串
                String[] sqlArr = Regex.Split(sql.Trim(), "\r\n\\s*go", RegexOptions.IgnoreCase);
                foreach (string strsql in sqlArr)
                {
                    if (strsql.Trim().Length > 1 && strsql.Trim() != "\r\n")
                    {
                        cmd.CommandText = strsql;
                        int r = cmd.ExecuteNonQuery();
                        if (r > 0)
                        {
                            effectedRows += r;
                        }
                    }
                }
            }
            catch (System.Data.SqlClient.SqlException E)
            {
                throw new Exception(E.Message);
            }
            finally
            {
                CloseConnection();
            }
            return(effectedRows);
        }
        public static void CloseConnection()
        {
            if (!ConnectionOpenned())
            {
                return;
            }

            try
            {
                SqlServerConnection.GetConnection().Close();
            }
            catch (Exception)
            {
                throw;
            }
        }
 public static void OpenConnection()
 {
     if (ConnectionOpenned())
     {
         return;
     }
     if (GetConnection().State == ConnectionState.Connecting)
     {
         throw new Exception("无法建立数据库连接,数据库状态为正在连接");
     }
     try
     {
         TimeUtil.Tik();
         SqlServerConnection.GetConnection().Open();
         TimeUtil.Tok();
     }
     catch (Exception)
     {
         throw;
     }
 }