本文介绍了如何设置连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

我创建了一个网站并使用了实体框架和数据库,当我在localhost中运行它工作正常但是当我在服务器上托管网站并浏览我的网站时我得到了这个错误:



内部服务器错误

服务器遇到内部错误或配置错误,无法完成请求。



和我的连接字符串是:

Hello All,
I have created a website and have used entity framework with database,when I run in localhost it works fine but when I host the website on server and browse my website i get this error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

and my connectionstring is this:

<connectionStrings>
    <add name="DBEntities" connectionString="metadata=res://*/App_Code.DB.csdl|res://*/App_Code.DB.ssdl|res://*/App_Code.DB.msl;provider=System.Data.SqlClient;provider connection string="data source=local;initial catalog=DB;persist security info=True;user id=user1;password=pass1;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>



有什么问题?如何解决这个问题?

请帮帮我。

先谢谢。


what is wrong?how do solve this?
please help me.
Thanks in Advance.

推荐答案


这篇关于如何设置连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:36
查看更多