简体   繁体   中英

Write back error to datatable bulkcopy C#

I want to make import data from.xlsx to database the flow as:

xlsx->datatable->database

I copy data from excel to temp table and insert, update to official table later Everything above work OK but now i'm stucking at writing back error if have(data already had, constraint...) to specific field of corresponding row in datatable and view to DataGrid

If you went through this problems, please advise me the best way to do it Thank you with highly appreciate.

try to use this library https://www.nuget.org/packages/ExcelDataReader/ to read.xlsx and load in DataSet / DataTable. Then run the validations in your datatable.

Its better to have a seperate datatable which you will be binding to DataGrid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM