Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

Delete record in Linq

 

Code snippet: delete record

 

call

clsDB.Delete_byID(IDProject_on_Server);

 

 

Code on WPF, Linq, Entity Framework

public static void Delete_byID(long id)

{

    //----------< Get_RefNr_OnServer_toDelete()>------------

    var db = new dbAppData_Context();

 

    tbl_Scans recordset = db.tbl_Scans.FirstOrDefault(s => s.IDScan == id);

    if (recordset != null)

    {

        db.tbl_Scans.Remove(recordset);

        db.SaveChanges();

    }        

    //----------</ Get_RefNr_OnServer_toDelete()>------------

}

 

 

 

 

 

 

 

 

Mobile
»
the type or namespace name dbAppData_Context does not exist
»
Delete record in Linq
»
Code snippet: Create Linq Select table from ID number fields
»
EF: Determine new ID of a data record
»
Asp MVC: Output Data from SQL Server directly to a List Type
»
Linq: Query data with a left join
»
Asp Linq: Collect data with a LINQ query from SQL Server

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de