How to import a csv file mapping the data from one table

dcs

New member
Joined
Apr 9, 2012
Messages
2
Programming Experience
Beginner
Hi All,

I have three tables in my SQL Server DB. I need to import some CSV files into these tables.
First table is a Order Table, which will contain all the order level information from that customer in that CSV File.
Each order has multiple items and the second table is an item level data.
Third table is a mapping table which says for a Customer say A ,

field 1 of Order Table = field 3 of Customer's CSV file,
Field 2 of Item Level Table is field 4 of Customer's CSV
and so on..

I need to create an application which takes a csv file and goes to the mapping table and checks what are the customer's field names and map with the order level table and item level tables and put all the data in the respective fields.

Please suggest how to proceed with this using VB.NET . I am very new with VB.Net any help appreciated.
 
Be careful! Customer data is very rarely up to spec for direct import into a production database. I do data imports for customers of an ERP package quite often, and most of the time I do it through Access queries, manually. Almost 100% of the time I have to sort out duplicates, illegal characters, empty fields, etc... I have thought about automating it a bit more, but in the end came to the conclusion it isn't worth it, there is just no way i could build an import filter intelligent enough to manage all those cases.
 
Hi Herman,

Thanks for your response. I will have to have validations in place for this.

But i need to know how to create a vb.net Application which can check the mapping table and map each column of csv file to the respective column int he Order table or Item Table.

TA,
Dcs
 
Back
Top