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