字符串:string connString="Data Source=.;Initial Catalog=trip;Persist Security Info=True;User ID=sa;Password=123456";
对象:SqlConnectionStringBuilder csbuidler = new SqlConnectionStringBuilder();
csbuidler.DataSource = ".";
csbuidler.InitialCatalog = "TestDB";
csbuidler.UserID = "sa";
csbuidler.Password = "123456";
SqlConnection conn = new SqlConnection(csbuidler.ConnectionString);