从ASP.Net到SQL的Windows身份验证连接 [英] Windows authenticated connection from ASP.Net to SQL

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

问题描述





我创建了一个使用SQL Server身份验证连接到sql server的应用程序,如下所示



add name =ConnectionStringconnectionString =Data Source = hostname; Initial Catalog = databasename; User ID = UID; Password = pwdproviderName =System.Data.SqlClient



现在我想使用Windows身份验证建立连接,即坚持安全信息=真;



你能帮助我改变我应该做的在我的ASP.Net应用程序和SQL服务器数据库中



提前谢谢

Hi,

I have created an application which connects to sql server using SQL server authentication as shown below

add name="ConnectionString" connectionString="Data Source=hostname;Initial Catalog=databasename;User ID=UID;Password=pwd" providerName="System.Data.SqlClient

Now i want to make connectivity using windows authentication i.e Persist Security Info=True;

Can you please help me with the changes that i should make in my ASP.Net application and in SQL server database

Thanks in advance

推荐答案

看看怎么样在这附近: http://www.connectionstrings.com/sql-server-2008 [ ^ ]。但我建议您不要将Persist Security Info设置为true,甚至更少,因为它没有ctual与windows身份验证一起使用。



但是一定要有所有必要的情况让Windows身份验证真正起作用:http://msdn.microsoft.com/en-us/library/bb669066.aspx [ ^ ]
What about looking around here: http://www.connectionstrings.com/sql-server-2008[^]. But I suggest you don''t set Persist Security Info to true, even less, because it has no actual use in conjunction with windows authentication.

But be sure to have all necessary circumstances to have windows authentication actually working: http://msdn.microsoft.com/en-us/library/bb669066.aspx[^]


使用此连接字符串



use this connection string

<add key="ConnectionString" value="Data Source=hostname;Database=databasename;Integrated Security=SSPI;" />


会有不需要所有者许可。您可以像这样更改连接字符串:Server = myServerAddress; Database = myDataBase; Trusted_Connection = True;



这样就足够了,不应该给出任何错误。无需更改任何其他内容。
There would be no owner permission needed. You can just change your connection string like this : Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

It will be enough and it should not give any error. There is no need to change anything else.


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

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