Sql server 2012 为什么我的连接字符串不工作?
我想上传我的网站。我上传了数据库的备份文件,主机给我的连接字符串是:Sql server 2012 为什么我的连接字符串不工作?,sql-server-2012,entity-framework-5,connection-string,Sql Server 2012,Entity Framework 5,Connection String,我想上传我的网站。我上传了数据库的备份文件,主机给我的连接字符串是: Provider=sqloledb;Data Source=127.0.0.1;User Id=sama;Password=****; 我在web.config文件中设置连接字符串如下: <connectionStrings> <add name="MyDBContext" connectionString="Data Source=127.0.0.1;User Id=sama;
Provider=sqloledb;Data Source=127.0.0.1;User Id=sama;Password=****;
我在web.config
文件中设置连接字符串如下:
<connectionStrings>
<add name="MyDBContext"
connectionString="Data Source=127.0.0.1;User Id=sama;Password=****;Initial Catalog=sama;"
providerName="sqloledb" />
</connectionStrings>
但是我的网站不工作
我在项目中使用实体框架代码优先模型
我的问题在哪里
谢谢。试试这样的
<connectionStrings>
<add name="MyDBContext"
providerName="System.Data.SqlClient"
connectionString="Server=127.0.0.1;Database=sama;User Id=sama;Password=****;"/>
</connectionStrings>
您是否收到任何反馈?有错误消息吗?@AlexBarroso:是的,显示了我在web.config中为customErrors设置的错误页面!禁用customErrors页面,以便查看错误detail@AlexBarroso:谢谢,我知道,我知道我的问题在哪里。