Hi All,
I want to store a csv file in sql table can u help me please..
If I am using excel file except csv it is working fine..
But when I am using csv file it is throwing exception "External table was not in correct format".
Please help me
Anish
Loading
Amit ChoudharyPosted Mar 26, 2010, 9:16 AM
use following code to read text csv file and fetch the data into dataset:
In this code The method GetMyCSVFileData() is used to read the .CSV file. This function read the Mycsvfile.txt file and store the data into the dataset. We can get the data from dataset.
please mark as answer if it helps.
Anish KhanPosted Mar 29, 2010, 8:41 AM
You can't understand....
See Amit's post.....
-------------
Anish
Anish KhanPosted Mar 29, 2010, 8:39 AM
Thanks for reply,
Your code are working fery fine...............
I Used GetMyCSVFileData(){} function to read data and store it in to dataset.
And after that I used SQLBulkCopy to store it into database table
It's very usefull code.
Thanks Again
Anish
Sushta GuthnarPosted Mar 26, 2010, 2:45 PM
Shusta
Sam HobbsPosted Mar 26, 2010, 1:03 PM