本文介绍了“不支持指定的方法."在实体框架中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的实体类,列为
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="Data Source=@;Database=NERDDINNER;User ID=@;Password=@@@;MultipleActiveResultSets=True"" 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.
更多推荐
“不支持指定的方法."在实体框架中
发布评论