Please look at my very first comment
Quote:
At quick glance I would say it's because you call adapter.Fill(table); after adding the column - try doing that first
Change your code to fill the table before you even attempt to add a column
Based on your new code in your comment you are now adding new rows to the table instead of filling in the new column details
Try something like this (warning, not tested or compiled):
adapter.Fill(table);
if (tablename == "TestData")
{
var pathC = @"H:\claimdetails\claims\names.txt";
string[] result = File.ReadAllLines(pathC);
DataColumn Col = table.Columns.Add("Name", typeof(String));
Col.SetOrdinal(0);
foreach (DataRow row in table.Rows)
{
row["Name"] = result[i++];
}
}