SQL SERVER数据库的两种连接模式
•1、混合模式连接
•使用此种连接模式必须输入登录名和登陆口令。
•例如:
•string myconnection = "server=(local);database=news;uid=sa;pwd=123456";
•SqlConnection conn = new SqlConnection(myconnection);
2、windows模式连接
•以windows连接模式必须将trusted_connection=true
•
•string myconnection = "server=(local);database=news;
trusted_connection=true";
• SqlConnection conn = new SqlConnection(myconnection);
其中(local)可以用localhost或者.代替!!!!
