如何解决“不支持关键字:'元数据'”? [英] How do I solve "Keyword not supported: 'metadata' "?

查看:192
本文介绍了如何解决“不支持关键字:'元数据'”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法连接到SQL Server,我的项目的连接字符串为:

I can't connect to SQL Server and connection string of my project is:

<add name="Teleport_DEVEntities" connectionString="metadata=res://*/Data.Model.AdvertisingModel.csdl|res://*/Data.Model.AdvertisingModel.ssdl|res://*/Data.Model.AdvertisingModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=*****;initial catalog=****;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

我收到此错误:


不支持关键字:'元数据'

Keyword not supported: 'metadata'

如何解决此错误?

推荐答案

该连接字符串仅受Entity Framework支持。 (公平地说,关键字 entities在键名中!)如果要在ADO原始连接中使用连接字符串,请除去& 字符串部分,包括& s:

That connection string is only supported by Entity Framework. (To be fair, the keyword "entities" is in the key name!) If you want to use the connection string in an ADO raw connection, remove anything outside the &quot; string parts, including the &quot;s:

将其更改为:

<add name="Teleport_DEVEntities" 
  connectionString="data source=*****;initial catalog=****;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" 
  providerName="System.Data.EntityClient" 
/>

这篇关于如何解决“不支持关键字:'元数据'”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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