Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to write Linq-To-SQL statment which is equal to my following TSQL?
- Update table1
- Set Name = 'John',
- Address = null
- where
- ID = 1
- var tab = db.Table1.Single(s => s.ID == 3);
- tab.Name = DateTime.Now;
- tab.Address = null;
- db.SubmitChanges();
- using (var dataContext = new MyEntities())
- {
- var contact = Contacts.Single (c => c.ContactID == 1);
- contact.FirstName = 'John';
- contact.Address= 'Toronto';
- dataContext.SaveChanges();
- }
- var entity = context.Table1.Single(t => t.Id == 1);
- entity.Name = "John";
- entity.Address = "Toronto";
- context.SubmitChanges();
Add Comment
Please, Sign In to add comment