实体框架工作连接问题ASP.NET [英] Entity frame work connection problem ASP.NET

查看:75
本文介绍了实体框架工作连接问题ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我今天刚刚上传了我的网站,但我遇到了连接字符串的问题,代码在本地服务器上工作了100%但是我想要放在服务器上。





但错误是实体框架连接字符串。



这是错误:

hello everybody,

I just uploaded my website today but I got a problem with connection string, the code was working 100% in local server but I want to put on the server.


but the error is with the entity framework connection string.

this is the error:

System.ArgumentException: Format of the initialization string does not conform to specification starting at index 99.







我试过这段代码:




I tried this code :

<add name="DefaultConnection" connectionString="Data Source=servername;Initial Catalog=SA_Quran_DB;Integrated Security=False;User ID=SA_Quran_DB;Connect Timeout=15;Encrypt=False;Packet Size=4096;Password=SA_QU_pobme^%$876;" providerName="System.Data.SqlClient" />

<add name="QuranDBEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=servername;Initial Catalog=SA_Quran_DB;Integrated Security=False;User ID=SA_Quran_DB;Connect Timeout=15;Encrypt=False;Packet Size=4096;Password=SA_QU_pobme^%$876;" providerName="System.Data.EntityClient" />







我不知道究竟是什么错误,我应该怎么做。



PS我出于安全原因隐藏了数据源中的服务器名称,但是我正确地添加了它



我尝试了什么:



我尝试创建连接,如前所述,但仍然没有连接




I don't know what exactly the mistake and what should I do.

P.S. I hide the server name in Data Source for security reasons but I add it correctly

What I have tried:

I tried to create the connection as I mention before but still no connection

推荐答案

876; providerName = System.Data.SqlClient />

< add name = QuranDBEntities connectionString = < span class =code-string> metadata = res://*/Model1.csdl | res://*/Model1.ssdl | res://*/Model1.msl; provider = System.Data.SqlClient; provider connection string =& quot; Data Source = servername; Initial Catalog = SA_Quran_DB; Integrated Security = False; User ID = SA_Quran_DB; Connect Timeout = 15; Encrypt = False; Packet Size = 4096; Password = SA_QU_pobme ^%
876;" providerName="System.Data.SqlClient" /> <add name="QuranDBEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=servername;Initial Catalog=SA_Quran_DB;Integrated Security=False;User ID=SA_Quran_DB;Connect Timeout=15;Encrypt=False;Packet Size=4096;Password=SA_QU_pobme^%


876; providerName = System.Data.EntityClient />
876;" providerName="System.Data.EntityClient" />







I不知道究竟是什么错误,我该怎么做。



PS我出于安全原因隐藏了数据源中的服务器名称,但是我正确地添加了它



我尝试了什么:



我试图按照我之前提到的那样创建连接,但仍然没有连接




I don't know what exactly the mistake and what should I do.

P.S. I hide the server name in Data Source for security reasons but I add it correctly

What I have tried:

I tried to create the connection as I mention before but still no connection


这篇关于实体框架工作连接问题ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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