LINQpad: Global function SubmitChanges not found

我只是一个虾纸丫 提交于 2019-12-25 16:39:49

问题


I've got a C#-Statement in LINQpad 4.0 like this:

var x = (from y in MyTable
where y.ID == 12345
select y).Single(); 
x.PropA = "abc";
SubmitChanges();

When i execute the Statements i get the error The name "SubmitChanges" is not available in the current context

How can i fix the problem or update my data using linqpad? On my research i just found something about using a second datacontext, but it should work with the first context...


回答1:


Most likely, you've not set a database (connection). Choose a database from the dropdown list above the query, or drag a connection from the Schema Explorer on the left onto your query.




回答2:


For the Entity Framework, you'll need to use the method SaveChanges() msdn.



来源:https://stackoverflow.com/questions/7388318/linqpad-global-function-submitchanges-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!