laudy的博客

人变聪明容易,但想装糊涂可真难
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

怎么写连接字符串的网站(转载)

Posted on 2007-03-13 12:55  laudy  阅读(222)  评论(0)    收藏  举报
http://www.connectionstrings.com/
一、多种连接字符串连接数据库的写法(连接SQL Server)(已经经过测试)
         1、String strConnection="server=(local);database=Northwind;integrated security=true;";
         2、String strConnection="Data Source=(local);Initial Catalog=Northwind;User Id=laudy;Password=52lisa1314;";
         3、String strConnection="Server=(local);Database=Northwind;User ID=laudy;Password=52lisa1314;Trusted_Connection=False;";
         4、String strConnection="Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI;";
         5、String strConnection="Server=(local);Database=Northwind;Trusted_Connection=True;";
         6、String strConnection="Data Source=(local);Network Library=dbnmpntw;Initial Catalog=Northwind;User ID=laudy;Password=52lisa1314;";
         7、String strConnection="Server=(local);Database=Northwind;User ID=laudy;Password=52lisa1314;Trusted_Connection=False;Packet Size=4096;";