如何设置连接字符串 [英] How do I set connection string

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

问题描述

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.

推荐答案

Hello WebDesigner,



检查服务器的错误日志。

你分享的错误信息是模糊和通用的。



所以我可以建议你做一些步骤:



1:尝试重新启动服务器或VM。

2.尝试重新启动IIS中的应用程序池。

3.尝试删除和再次创建应用程序池。



(FYI)此错误与连接字符串没有任何关联:)
Hello WebDesigner,

Check your server's error logs.
The error message you have shared is vague and generic.

So some steps I can suggest you to have:"

1:Try restarting the server or VM.
2.Try restarting the Application pool in the IIS.
3.Try deleting and creating the Application pool once again.

(FYI)This error doesnt have any connection with the connection string:)


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

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