我托管应用程序时无法连接数据库 [英] Unable To Connect Database When I Host The Application

查看:95
本文介绍了我托管应用程序时无法连接数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在本地使用visual studio 2008和数据库SQL server 2008管理工作室。

通常我能够连接数据库。查看更新所有这些东西都可以在本地机器上完成。但是当我在服务器上发布时,如果不使用服务器凭证,则无法访问数据。当我在Web.config文件中使用服务器凭证时,我可以访问数据,但我不想这样做我该怎么办?



ss

Hi,
I am using visual studio 2008 & database SQL server 2008 Management studio on local.
Normally i can able to connect database. View update all this things can done on Local machine. But when i publish on server i unable to access data without using Server credential. When i use Server credential in Web.config file i can be access data but this i don't want so what can i do?

ss

推荐答案

可能没有。

本地连接通常使用Windows授权,因此连接字符串通常包含Integrated Security = True。

生产数据库需要更加安全,因此他们使用SQL登录,连接字符串需要包含用户ID = AAA;密码= BBB。



这有很多原因,例如您可以完全访问的本地deb,用户应限制为特定数据库的生产,以及该DB中的特定操作(例如,一般用户不应该是给予删除权限)



如果您的生产数据库设置为使用登录,他们可以要求数据库管理员允许您进行Windows授权,但我怀疑他的回复将是不 - 可能有一些辱骂性的语言年龄增加。
Probably nothing.
Local connections generally use Windows authorization, so the connection string generally includes "Integrated Security=True".
Production databases need to a be a lot more secure, so they use SQL login, and the connection string needs to contain "User ID=AAA;Password=BBB" instead.

There are a lot of reasons for this, like your local deb you have full access to, the production your users should be restricted to specific databases, and specific actions within that DB (for example, "general users" should not be given delete permissions)

If you production DB is setup to use a login, they you could ask the DB admin to allow you Windows authorisation, but I suspect his reply will be "No" - probably with some abusive language added.


这篇关于我托管应用程序时无法连接数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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