I have data table having 5 colom data and which is am fetching from database.Now i have to add a new colom like below that is not from the DB but from my text file path.
NAME
.......
Jhonathan
Tony
Mika
haris
shaju
mathew
How i can add this colom in the first position of my data table?
Jignesh KumarPosted Dec 9, 2021, 4:04 AM
Srinivasan RamamoorthiPosted Dec 8, 2021, 3:08 PM
Sujeet RamanPosted Dec 8, 2021, 2:14 PM
below is my table creation code and i am getting data table with DB values .How i can add my txt file as first column
private static DataTable LoadTable(string connectionString, string query, string tableName)
{
using (var connection = new OdbcConnection(connectionString))
using (var command = new OdbcCommand(query, connection))
using (var adapter = new OdbcDataAdapter(command))
{
command.CommandTimeout = 0;
var table = new DataTable(tableName);
adapter.Fill(table);
return table;
}
}
Srinivasan RamamoorthiPosted Dec 8, 2021, 1:58 PM