using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
These are my namespaces. I was looking for System.Data.Linq; but it seems to be nowhere, and I think this is what has been ported to System.Linq, since I have access to most of the other things in Linq. I found System.Data:Linq, but no difference.
Here is my method:
public void deleteStudienummer(int studienummer)
{
dbcontent = new DBEntities();
var dQry = from members in dbcontent.Medlemmer
where members.Studienummer == studienummer
select members;
foreach (var member in dQry)
{
dbcontent.***
}
dbcontent.AcceptAllChanges();
Console.WriteLine("delete member should have occured");
}
***I was supposed to be DeleteOnSubmit, but I have only DeleteDatabaseand DeleteObjectI tried the latter, but it does not work.
You also tried dbcontent.Medlemmer.*, but still were not present.
And it AcceptAllChanges()should have been .submitChanges(), but it wasn’t.
source
share