SQL2008生成鏈接字符串

  private static string connStr
        {
            get
            {
                SqlConnectionStringBuilder sb = new SqlConnectionStringBuilder();
                sb.DataSource = "127.0.0.1";
                sb.InitialCatalog = "數據庫名稱";
                sb.UserID = "登錄名";
                sb.Password = "登錄密碼";
                sb.IntegratedSecurity = false;
                return sb.ConnectionString;
            }
        }
相關文章
相關標籤/搜索