Sql Windows身份验证 [英] Sql Windows Authentication

查看:106
本文介绍了Sql Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了以下连接字符串。

_HR = new SqlConnection(String.Format(Data Source = SERVER; Initial Catalog = HR; Persist Security Info = True; User ID = sa;密码= 123));

我想删除密码,应该使用SQL Windows身份验证。如何修改连接字符串。在此先感谢。

I have used the following connection string.
_HR = new SqlConnection(String.Format("Data Source=SERVER;Initial Catalog=HR;Persist Security Info=True;User ID=sa;Password=123"));
I want to remove password and should use SQL Windows Authentication. How can I modify my connection string. Thanks in advance.

推荐答案

尝试 Trusted_connection

Try Trusted_connection:
HR = new SqlConnection(String.Format("Data Source=SERVER;Initial Catalog=HR;Persist Security Info=True;Trusted_Connection=True"));



有关详细信息,请参阅: SqlConnection.ConnectionString属性 [ ^ ]


这篇关于Sql Windows身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆