我如何将我的sql db文件连接字符串保存到web.config文件中 [英] How can i save my sql db file connection string into web.config file

查看:100
本文介绍了我如何将我的sql db文件连接字符串保存到web.config文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将sql文件连接字符串保存到web.config文件中.但我有一些错误.我的数据库文件位于App_Data文件夹内,名称为HOSTEL.
这是我尝试使用的代码:

I am trying to save my sql file connection string into the web.config file. but i am having some erros. My database file is located inside the App_Data folder and the name is HOSTEL.
here is the code i am trying to work with:

<connectionstrings>
   <add name="WatcherConStr" connectionstring="Data Source=.\sqlexpress;Initial Catalog=HOSTEL;Integrated Security=True; User Instance=True" providername="System.Data.SqlClient" />
 </connectionstrings>



这是错误:

连接错误:无法打开登录请求的数据库"HOSTEL".登录失败.用户"DJAMA-PC \ Joel Mocke"的登录失败.


请提供任何帮助???



here is the error:

connection Error:Cannot open database "HOSTEL" requested by the login. The login failed. Login failed for user ''DJAMA-PC\Joel Mocke''.


Please, any help ???

推荐答案

您的SQL数据库无法识别您传递的Windows身份验证令牌.

简而言之,您的连接字符串正确,您的SQL DB不接受Windows Auth,特别是您用来尝试登录的用户.
Your SQL databse doesn''t recognize the Windows Authentication token you passed.

In short, your connection string is right, your SQL DB doesn''t accept Windows Auth, specifically the user you''re using to try and login.


这篇关于我如何将我的sql db文件连接字符串保存到web.config文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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