Need to input data froma csv file into SQL server using VB.Net using mapping from a table in SQL DB

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="color:#333333; font-family:Helvetica,Arial,Verdana,sans-serif; font-size:14px; line-height:normal Hi All,<span style="color:#333333; font-family:Helvetica,Arial,Verdana,sans-serif; font-size:14px; line-height:normal
<span style="color:#333333; font-family:Helvetica,Arial,Verdana,sans-serif; font-size:14px; line-height:normal 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 shows the mapping for each customer . for a Customer say A ,
<span style="font-family:Helvetica,Arial,Verdana,sans-serif; font-size:14px; color:#333333; line-height:normal
field 1 of Order Table = field 3 of As CSV file,
Field 2 of Item Level Table = field 4 of As 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 customers field names and map with the order level table and item level tables and put all the data in the respective fields.
The csv file will look something like this:-
PO,OrderNum123,Item-ABC,21-05-2012,Supplier1,..
Mapping Table will be like this
CustomerID, DBOrderLevel_ColumnName, CSVColumnNumber, DBItemLevel_ColumnName
C1 PO 1
Null
C1 Null 3
Item_Num

Please suggest how to proceed with this using .NET . I am very new with .Net any help appreciated.
Thanks in advance.
Regards,
dcs



View the full article
 
Back
Top