I ran a query and returned a datatable,
myDataAdapter.Fill(myDataTable);
Now what is the best way to load the row values \"Value\" and \"Te
It's way too late for me to answer but I think this might be an optimized way to do it, hope it works.
List listName= new List();
for (int i = 0; i < datatableName.Rows.Count; i++)
{
listName.Add(new SelectListItem { Text = datatableName.Rows[i]["ColumnName"].ToString(), Value = datatableName.Rows[i]["ColumnName"].ToString() });
}
You can also loop through the column names as well by applying another loop and using that as an index at the column identifier of the datatable.
Thank You.