Reputation: 1518
how to retrieve the value(string form) from dataTable and assign that value to int varaible.. would any one pls give idea about this
Upvotes: 0
Views: 202
Reputation: 1118
DataTable table = GetTable(); //Gets the DataTable
foreach (DataRow row in table.Rows)
{
foreach (var item in row.ItemArray) // Loops over all the items.
{
string val = item;
}
}
Upvotes: 0
Reputation: 13756
int value = 0;
int.tryParse(DataTable.Rows[0][0].ToString(), out value);
Upvotes: 1