Hiii
plz help me how to export the access data or Table into CSV format using Asp.net with c#.
Hiii
plz help me how to export the access data or Table into CSV format using Asp.net with c#.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bechir BejaouiPosted Nov 19, 2008, 5:03 PM
foreach (DataTable t in ds.Tables)
{
oList.Add(t.TableName);
oList.Add(Environment.NewLine);
foreach (DataRow r in dt.Rows)
{
foreach (DataColumn c in dt.Columns)
{
oList.Add(c.Caption + " " + r[c].ToString() + " ");
}
}
oList.Add(Environment.NewLine);
oList.Add(Environment.NewLine);
}
System.IO.File.WriteAllLines(@"C:\myFile.csv", oList.ToArray());
oConn.Close();
MessageBox.Show("Done");