简体   繁体   中英

How to compare database table with excel with same columns in c#?

I have one database table.And I have excel spreadsheet.The columns of these two tables are the same.I would like to compare the ID values ​​of these two tables and find them if they do not match the ID values ​​and save them to the database table.

STUDENTSINFORMATION 学生信息

STUDENTS (ID,NAME,CLASS) 学生(ID,名称,类)

(ID,NAME,CLASS) (ID,NAME,CLASS)

I want to Students (ID) and Excel table (ID) column I would like to compare the columns and insert these ids or ids into the students table if there are 1 different ids. How can I do this?

I would suggest you import your data from the Excel into a separate database table and then write the appropriate SQL to compare the two tables and then insert the difference into the final table. Which database are you using?

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