H
HinduNationalist
I have the following Test.CSV file:
Col1,Col2,Col3
1,4,7
2,5,8
3,6,9
I have created a table:
DataColumn dc1 = new DataColumn("B1");
DataColumn dc2 = new DataColumn("B2);
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
I want to select Col1, Col2 into dt.
How should I do it?
I can do the following:
using (OleDbCommand cmd =
new OleDbCommand("SELECT * FROM Test.csv" , conn))
{
da = new OleDbDataAdapter(cmd);
da.Fill(ds);
}
But I want to just have selected values into dt.
Col1,Col2,Col3
1,4,7
2,5,8
3,6,9
I have created a table:
DataColumn dc1 = new DataColumn("B1");
DataColumn dc2 = new DataColumn("B2);
dt.Columns.Add(dc1);
dt.Columns.Add(dc2);
I want to select Col1, Col2 into dt.
How should I do it?
I can do the following:
using (OleDbCommand cmd =
new OleDbCommand("SELECT * FROM Test.csv" , conn))
{
da = new OleDbDataAdapter(cmd);
da.Fill(ds);
}
But I want to just have selected values into dt.