“不支持指定的方法."在实体框架中

编程入门 行业动态 更新时间:2024-10-12 05:44:03
本文介绍了“不支持指定的方法."在实体框架中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我的实体类,列为

this is my entity class listed as

public partial class NerdDinnerEntities : ObjectContext { #region Constructors public NerdDinnerEntities(string connectionString) : base(connectionString, "NerdDinnerEntities") { try { ObjectContext oc = new ObjectContext(connectionString); oc.Connection.ChangeDatabase("NERDDINNER1"); oc.AcceptAllChanges(); this.ContextOptions.LazyLoadingEnabled = true; OnContextCreated(); } catch (Exception ex) { } } #endregion #region Partial Methods partial void OnContextCreated(); #endregion #region ObjectSet Properties /// /// No Metadata Documentation available. /// public ObjectSet Dinners { get { if ((_Dinners == null)) { _Dinners = base.CreateObjectSet("Dinners"); } return _Dinners; } } private ObjectSet _Dinners; /// /// No Metadata Documentation available. /// public ObjectSet RSVPs { get { if ((_RSVPs == null)) { _RSVPs = base.CreateObjectSet("RSVPs"); } return _RSVPs; } } private ObjectSet _RSVPs; /// /// No Metadata Documentation available. /// public ObjectSet sysdiagrams { get { if ((_sysdiagrams == null)) { _sysdiagrams = base.CreateObjectSet("sysdiagrams"); } return _sysdiagrams; } } private ObjectSet _sysdiagrams; #endregion #region AddTo Methods /// /// Deprecated Method for adding a new object to the Dinners EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// public void AddToDinners(Dinner dinner) { base.AddObject("Dinners", dinner); } /// /// Deprecated Method for adding a new object to the RSVPs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// public void AddToRSVPs(RSVP rSVP) { base.AddObject("RSVPs", rSVP); } /// /// Deprecated Method for adding a new object to the sysdiagrams EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// public void AddTosysdiagrams(sysdiagram sysdiagram) { base.AddObject("sysdiagrams", sysdiagram); } #endregion }

这是我的web.config文件,

and these is my web.config file as

<add name="NerdDinnerEntities" connectionString="metadata=res://*/Models.NerdDinner.csdl|res://*/Models.NerdDinner.ssdl|res://*/Models.NerdDinner.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=@;Database=NERDDINNER;User ID=@;Password=@@@;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClients" />

我在这行中得到错误,因为

and i am getting error in this line as

oc.Connection.ChangeDatabase("NERDDINNER1");

不支持指定的方法. 我不知道该如何进行?您能否提出宝贵的建议?

Specified method is not supported. i do not know how to proceed can u give ur valuable sugessions

推荐答案

不支持意味着不支持.这意味着它还行不通. Not supported means not supported. It means it doesn''t work, yet.

更多推荐

“不支持指定的方法."在实体框架中

本文发布于:2023-06-11 00:09:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/621955.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不支持   实体   框架   方法   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!