Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

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

.

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