Last post Oct 21, 2010 08:49 AM by riswadkarharshad
Oct 21, 2010 03:13 AM|srm2009|LINK
I am trying to delete record from table with proper mapping
from linq to sql.There is an error stating that Rmove method not found and are u missing an assembly reference.
What exactly requires to do?
AdventureWorks db = new AdventureWorks("Integrated Security=sspi");
var query = from con in db.Contact
where con.LastName == "Klein"
foreach (Contact del in query)
db.Contact.Remove(del);//???Remove not working
textBox1.Text = "Contact deleted.";
Thank you in advance
Oct 21, 2010 08:49 AM|riswadkarharshad|LINK
You can use the method DeleteOnSubmit() instead of Remove() and pass del object as parameter to it.
I hope this helps.