I have a requirement where I need to check for data duplication before the data is sent to database.
Basically, we have a EXCEL file which contains the required data in columns and sheets. We need to upload the data from EXCEL to our SQL Server 2008 DB.
Before uploading the data, we load the EXCEL data using "Microsoft.Ace.OLEDB.12.0" and display to the users using WPF Grid - This works fine.
The next step is to check the data loaded from EXCEL file against the data available in SQL Server DB. We have a primary column called invoice number. This invoice number is spread across all the excel file as the shipment of requested goods is done partially. Till the entire items for this particular invoice is uploaded to the DB we need to make sure the data which is being uploaded is not already present in SQL Server DB.
The excel file has multiple columns but we need to check based on couple of columns for duplicate entry.
We are storing the loaded EXCEL data in .net datatable and planning to load the data from SQL Server to Dataset (Not sure if this is a good approach)
What is the suggested good practice to achieve this. I have seen this link Duplicacy check between DATABASE and DATATABLE but not sure if this would solve my requirement.
Thanks in advance.