Hi,
Do you have to write update statements with Linq to SQL?
Hi,
Do you have to write update statements with Linq to SQL?
Kinda. You can use it somewhat like an ORM in that you can update your in-memory data model, and then execute a dynamically generated UPDATE statement when you submit changes. For example:
using (MyDataContext db = new MyDataConext())
{
db.Clients.First().Salary = 50000;
}
does not perform an update, but
using (MyDataContext db = new MyDataConext())
{
db.Clients.First().Salary = 50000;
db.SubmitChanges();
}
does.