手遅れではないことを願っています=)ここで機能するものがあります...
// Entity Data Model
private ManagerEntities context = new ManagerEntities();
// declare private member
private BindingList<Currency> lstCurrencies = null;
// on form load, load data and bind to DataGridView's DataSource
private void Form1_Load(object sender, EventArgs e) {
lstCurrencies = new BindingList<Currency>();
ObjectResult or = ((ObjectQuery)currencies).Execute(MergeOption.AppendOnly);
foreach (Currency c in or)
lstCurrencies.Add(c);
// dgMain is my DataGridView
dgMain.DataSource = lstCurrencies;
}
// this will save objects that have changed. You might want to add logic for newly created and deleted objects.
private void btnSave_Click(object sender, EventArgs e) {
context.SaveChanges();
}