SqlConnection cnn = new SqlConnection(); cnn.ConnectionString = "Data Source=(local); Initial Catalog=NorthWind; integrated security =sspi;"; cnn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = cnn;
string str = "Data Source=(local); Initial Catalog=NorthWind; User ID=zhangsan; password=123";