问题
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