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;
            }
        }

  

posted @ 2015-01-25 16:34  风随叶舞  阅读(297)  评论(0编辑  收藏  举报