Bulk Insert records and Update existing rows if record exists using Entity Framework in ASP.Net

on Nov 14, 2019 03:47 AM

I am trying to insert 2-3K records from excel to DB in a table having more then 3 Lac data suppose table A and 3 other table B,C,D as well which has 20K around data.

I am inserting records in table A which contains reference column data from other 3. So, what should be the best practice?

1) Validating records and inserting data by Entity Framework

2) By using a Stored procedure in DB and passing all column values in it which will validate and insert data row by row.

How much performance difference can be in both ways and is there any better way then that?

Download FREE API for Word, Excel and PDF in ASP.Net: Download