标签:win manage connect 标记 string source initial 字符 config
//windows身份验证1 //string strCon = @"Data Source=.\sqlexpress;Initial Catalog=db1;Integrated Security=True;Pooling=False"; //windows身份验证2 //string strCon = @"server=.\sqlexpress;database=db1;Integrated Security=True;"; //Sql Server身份验证1 //string strCon = @"server=.\sqlexpress;database=db1;uid=sa;pwd=123456"; //Sql Server身份验证2 //string strCon = @"Data Source=.\sqlexpress;Initial Catalog=db1;User ID=sa;Password=123456;Pooling=False"; /* 从配置文件中读连接字符串 在<configuration>标记中加上 <connectionStrings> <add name="strCon" connectionString="server=.\sqlexpress;database=db1;uid=sa;pwd=123456"/> </connectionStrings> */ string strCon = ConfigurationManager.ConnectionStrings["strCon"].ConnectionString;
标签:win manage connect 标记 string source initial 字符 config
原文地址:http://www.cnblogs.com/beast-king/p/6492477.html