LinqPad to VFP does not offer SaveChanges()
Options
My code
... byt there is not SaveChanges() available in ctx.
var ctx = new DC.PLUCZ.PLUCZ(@Provider=VFPOLEDB; Data Source= v:\data\plucz\plucz.dbc;Password='';Collating Sequence=MACHINE);
// ctx.Numbers.Dump();
var nums = ctx.Numbers.OrderBy(n=>n.Num_Key).FirstOrDefault(n => n.Num_Key.Trim() == "OG");
nums.Num_Number ++;
Comments
-
I was able to do what I needed like this.
... but something tells me there must be a better way to just update a column in a table?
var ctx = new DC.PLUCZ.PLUCZ(@Provider=VFPOLEDB; Data Source= v:\data\plucz\plucz.dbc;Password='';Collating Sequence=MACHINE);
var nums = ctx.Numbers.OrderBy(n=>n.Num_Key).FirstOrDefault(n => n.Num_Key.Trim() == "OG");
nums.Num_Number ++;
ctx.Numbers.Delete(n => n.Num_Key == "OG");
ctx.Numbers.Insert(nums);
ctx.Numbers.OrderBy(n=>n.Num_Key).Dump();