Getting the error “cannot add an entity that already exists.” while inserting a table's value in to DB without procedure

前端 未结 5 1624
谎友^
谎友^ 2021-01-21 05:15

I am inserting a list of records to the DB table with Linq to sql like this:

//my DataContext Class
 using (VTMMedicalDBDataContext objVTMMedicalDBDataContext =          


        
5条回答
  •  爱一瞬间的悲伤
    2021-01-21 05:53

    As an alternative you can call stored procedure inside db which will do the insert: Updating database by using stored procedures.

提交回复
热议问题