连接字符串的写法

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

 

 

转载于:https://www.cnblogs.com/Jeffli91/archive/2013/05/27/3101181.html

你可能感兴趣的:(连接字符串的写法)