I created a .MDF database in my WPF application.
I then generated LINQ-to-SQL classes and used LINQ get all the customers.
Then I run through them and change each of their last names.
However, when I call SubmitChanges, the database remains unchanged.
I thought that was the purpose of SubmitChanges(), to submit changes to the database?
What am I missing, how do I "submit changes" back to my database?
public Window1()
{
InitializeComponent();
Main2DataContext _db = new Main2DataContext();
var customers = from c in _db.Customers
select c;
foreach (var customer in customers)
{
customer.LastName = "CHANGED lastname"; //ListBox shows changes
}
_db.SubmitChanges(); //does NOT save to database (???)
}