我在连接字符串问题中收到此错误 [英] I am getting this error in connection string issue

查看:46
本文介绍了我在连接字符串问题中收到此错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在尝试连接到mVC 5中的数据库我得到此错误...

Web.config:连接字符串

Hi i am trying to connect to databse in mVC 5 i ma getting this error ...
Web.config : connection string

<add name="SchoolContext" connectionstring="Data Source=Sayeed\SQLEXPRESS;Database=Say;Integrated Security=false" providername="System.Data.SqlClient" />





beow是出现任何解决方案的错误行这个..

EntityFramework.SqlServer.dll中出现'System.Data.Entity.Core.EntityException'类型的异常,但未在用户代码中处理



附加信息:底层提供程序在Open上失败。



The beow are the error line which occurs any solution to solve this..
An exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: The underlying provider failed on Open.

推荐答案

如果禁用Integerated Security,那么通常需要提供登录信息 - 你没有。



所以首先得到一个好的连接字符串。

尝试在VS中设置一个连接服务器资源管理器窗格:

1)打开服务器资源管理器。

2)右键单击数据连接并选择添加连接

3)在随后的对话框中,选择您的数据源和数据库,指定安全信息,然后按测试连接按钮。

4)当连接正常时,按确定

5)在服务器资源管理器窗格中突出显示数据库,然后查看属性窗格。将显示连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中。
If you disable Integerated Security, then you would normally have to provide login information - which you don't.

So start by getting a "good" connection string.
Try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.


您可以在app.config中更改,如下所示:persist security info = True ;用户ID = admin;密码= 123456;

在我的connectionStrings错过密码时,我遇到了问题,我的问题解决了。

祝你好运
you can change in app.config like this: persist security info=True;user id=admin;password=123456;
I have problem like you when in my connectionStrings miss Password, My problem is solved.
good luck


这篇关于我在连接字符串问题中收到此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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