I've populated a DataTable with a DataAdapter but I would like to change the values dynamically for all of the rows in that column in the DataTable. How do I go about doing this?
Here is my current code:
SqlConnection conn = null;
string sSQL = "";
string connString = "Datasourceetc";
sSQL = "SELECT TEST_ID FROM TEST_TABLE";
SqlDataAdapter sda = new SqlDataAdapter(sSQL, conn);
DataTable dt = new DataTable();
sda.Fill(dt);
foreach (DataRow row in dt.Rows)
{
dt.Columns["TEST_ID"] = "changed"; //Not changing it?!
}
GridView1.DataSource = dt;
GridView1.DataBind();
Thanks