另一种数据库连接字符串的编写方式(Sqlbuilder)

 

 

 

 

1         SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();

2 

3         builder.DataSource = "";

4         builder.InitialCatalog = "";

5         builder.IntegratedSecurity = true;

6 

7         string connectionString = builder.ConnectionString;

 

 

 

这样也可以构造数据库连接字符串。

 

你可能感兴趣的:(builder)