How to import csv via webpage

Posted by Vatcharm under ASP.NET AJAX on 2/22/2010 | Views : 2985 | Status : [Member] | Replies : 4
Hi Guru
How to import csv file into sql server 2005 via webpage asp.net?

thank you.




Responses

Posted by: Abhi2434 on: 2/22/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
CSV's are nothing but a series of Comma separated values. You can read the file directly and split using commas and get the data.

Other than that here is an article according to exactly what you need :

http://www.codeproject.com/KB/database/FinalCSVReader.aspx
http://www.codeproject.com/KB/database/Cs_CSV_import_export.aspx

I hope you will like this.

www.abhisheksur.com

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vatcharm on: 2/24/2010 [Member] Starter

Up
0
Down
Thanyou very much

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Up
0
Down
Check the following link
http://forums.asp.net/t/90818.aspx

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 3/26/2010 [Member] Bronze

Up
0
Down
private void writeSchema()

{
try
{
FileStream fsOutput = new FileStream(txtCSVFolderPath.Text+"\\schema.ini",Fi leMode.Create, FileAccess.Write);
StreamWriter srOutput = new StreamWriter (fsOutput);
string s1,s2,s3,s4,s5;
s1="["+strCSVFile+"]";
s2="ColNameHeader="+bolColName.ToString();
s3="Format="+strFormat;
s4="MaxScanRows=25";
s5="CharacterSet=OEM";
srOutput.WriteLine(s1.ToString()+'\n'+s2.ToString( )+'\n'+s3.ToString()+'\n'+s4.ToString()+'\n'+s5.To String());
srOutput.Close ();
fsOutput.Close ();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{}


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Vatcharm, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response