views:

208

answers:

1

Hullo to all! This question is more about a shortcut than anything:

Is there a simple, yet efficient way to associate column names to csv data?

Problem:

I need to associate column names (and bind them) to import the csv file correctly to my SQL Server database. I don't know before I see the csv what column of the csv will contain what data.

Example: File 1 column order: Name, Address, Phone. File 2 column order: Name, Phone, Address.

Hence, I need to be able to display the csv, and with the use of well-placed dropdownlists, show the remaining columns that need to be selected.

I need to create an interface that will allow for manual association of the csv column to the datatable column.

Solution: ?

I am caressing the idea of coding the stuff myself, but was asking myself whether or not an existing easier solution already existed, and Google wasn't much help on this one.

Any input from you guys would be infinitely appreciated as it would save me some precious time.

A: 

Other than just doing the import via SSIS or some other direct SQL item, I'm not aware of any better way of doing it.

All I would do in this case is show the list of columns for each field, and let the user select the mapping.

Mitchel Sellers
That's the initial plan, but I was hoping such a control had already been designed. I think I just might design something and throw that somewhere on the Internet to help fellow programmers allow users to import massive data from CSV while associating the column themselves.Granted, it has a somewhat limited field of use, but meh. If I'm searching for it, there might just be 5 other persons looking for the exact same solution.
MrZombie