简体   繁体   English

如何修复“在执行当前 Web 请求期间发生未处理的异常。”

[英]How to fix "An unhandled exception occurred during the execution of the current web request. "

I am trying to host an Asp.Net website with a database.我正在尝试使用数据库托管一个 Asp.Net 网站。 It's giving me an error, of can't open the database它给了我一个错误,无法打开数据库

I have tried to change the connection string but to no avail.我尝试更改连接字符串但无济于事。

This is the connection string:这是连接字符串:

<connectionStrings>
   <add name="WebSqlConnectionString" 
        connectionString="Data Source=MXOLISI\MSSQLSERVER2;,1432 ;database=NCEDA2014;User ID=NCEDA14;Password=7n63rDYtp38Ymfd;"/>
</connectionStrings>`

例外 另一个例外

I expect for the webpage to open the default page我希望网页打开默认页面

As the error clearly says your connection string has a wrong format.由于错误清楚地表明您的连接字符串格式错误。

<connectionStrings>
    <add name="WebSqlConnectionString" connectionString="Data Source=MXOLISI\MSSQLSERVER2,1432;
       database=NCEDA2014; User ID=NCEDA14;Password=7n63rDYtp38Ymfd;"/>
</connectionStrings>

You placed port number after semicolon which is not correct, it should be after server name.您在分号后放置了端口号,这是不正确的,它应该在服务器名称之后。

Try these steps first:首先尝试以下步骤:

  1. Open SQL server and try to access the database with the credentials mentioned in the config file.打开 SQL 服务器并尝试使用配置文件中提到的凭据访问数据库。 If it works fine, follow next step.如果它工作正常,请执行下一步。

  2. Check your connection string.检查您的连接字符串。 Use below code as you are having issue in your connection string:当您的连接字符串出现问题时,请使用以下代码:

     <add key="myConnectionString" value="server=localhost;database=myDb;uid=myUser;password=myPass;" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当前Web请求的执行期间发生未处理的异常。 型号兼容性无法检查 - An unhandled exception occurred during the execution of the current web request. Model compatibility cannot be checked 执行当前 Web 请求期间发生未处理的异常。 ASP.NET - An unhandled exception occurred during the execution of the current web request. ASP.NET 在执行当前Web请求期间生成了未处理的异常。[HttpAntiForgeryException] - An unhandled exception was generated during the execution of the current web request.[HttpAntiForgeryException] 当前Web请求“Ненайденуказанныймодуль”的执行期间发生未处理的异常 - An unhandled exception occurred during the execution of the current web request, “Не найден указанный модуль” 当前Web请求执行期间发生未处理的异常 - An unhandled exception occurred during the execution of the current web request 获取“在执行当前Web请求期间生成了未处理的异常。” 我的MVC UserManagementController中的错误 - Getting 'An unhandled exception was generated during the execution of the current web request.' Error in my MVC UserManagementController Sitecore MVC-在执行当前Web请求期间生成了未处理的异常 - Sitecore MVC - An unhandled exception was generated during the execution of the current web request 在执行当前Web请求asp net的过程中生成了未处理的异常 - an unhandled exception was generated during the execution of the current web request asp net 当前Web请求执行期间生成了未处理的异常 - An unhandled exception was generated during the execution of the current web request 执行过程中发生未处理的异常 - An unhandled exception occurred during the execution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM