数据库
首页 > 数据库> > C# 链接 sql server 数据库字符串

C# 链接 sql server 数据库字符串

作者:互联网

SqlConnectionStringBuilder sqlb = new SqlConnectionStringBuilder();
sqlb.DataSource = "ip address";
sqlb.InitialCatalog = "databasename";
sqlb.UserID = "username";
sqlb.Password = "password";
sqlb.IntegratedSecurity = false;
sqlb.Pooling = true;

SqlConnection conn = new SqlConnection();
conn.ConnectionString = sqlb.ConnectionString;
conn.Open();

  conn.Close();

标签:SqlConnectionStringBuilder,C#,ConnectionString,new,server,sql,SqlConnection,sqlb
来源: https://www.cnblogs.com/lionmxs/p/12115011.html