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或者.代替!!!!
本文介绍了 SQL Server 数据库的两种连接方式:混合模式连接和 Windows 模式连接。混合模式连接需要提供用户名和密码,而 Windows 模式连接则通过验证当前用户的 Windows 身份进行连接。
700

被折叠的 条评论
为什么被折叠?



