c# loop through datatable

74

c# loop through datatable -

DataTable dt = new DataTable();

SqlDataAdapter adapter = new SqlDataAdapter(cmd);

adapter.Fill(dt);

foreach(DataRow row in dt.Rows)
{
    TextBox1.Text = row["ImagePath"].ToString();
}

c# loop through datatable and update -

foreach (DataRow row in MyDataTable.Rows)
{
 row["columnNameHere" Or index] = value;
}

Comments

Submit
0 Comments