Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 不支持关键字:';数据源';在ASP.net实体框架6中_C#_Asp.net_Sql Server_Entity Framework_Connection String - Fatal编程技术网

C# 不支持关键字:';数据源';在ASP.net实体框架6中

C# 不支持关键字:';数据源';在ASP.net实体框架6中,c#,asp.net,sql-server,entity-framework,connection-string,C#,Asp.net,Sql Server,Entity Framework,Connection String,几天来我一直在绞尽脑汁想弄明白这一点 我正在使用winhost来托管SQL Server,我查找了许多相同问题的类似问题,但它们似乎都有一些格式错误,这是它们的问题 我的连接字符串怎么了 <add name="ContactsDb" connectionString="Data Source=tcp:s10.winhost.com;Initial Catalog=DB_84426_webdevct;User ID=DB_84426_webdevct_user;Password=*

几天来我一直在绞尽脑汁想弄明白这一点

我正在使用winhost来托管SQL Server,我查找了许多相同问题的类似问题,但它们似乎都有一些格式错误,这是它们的问题

我的连接字符串怎么了

<add name="ContactsDb"
     connectionString="Data Source=tcp:s10.winhost.com;Initial Catalog=DB_84426_webdevct;User ID=DB_84426_webdevct_user;Password=***********;Integrated Security=False;" 
     providerName="System.Data.EntityClient"/>


我必须将提供者名称从System.Data.EntityClient更改为System.Data.SqlClient。当连接到外部SQL Server数据库时,我错误地认为我需要EntityClient来实现实体框架的自动功能。谢谢Paresh J.

System.ArgumentException{“关键字不受支持:'数据源'。”}。没有内部异常。在提供程序中,您是否尝试过System.Data.SqlClient。检查此MSDN URL:这就成功了。非常感谢你。我觉得自己像个白痴我认为对于Entity Framework automagic数据库,我需要使用EntityClient。对于每个DbContext,我需要一个新的MSSQL数据库吗?或者我可以将多个DbContext连接到同一个连接,只要我为它们提供不同的名称就行了吗?我认为您可以使用相同的连接。。