如何从dataTable中检索值(字符串形式)并将该值赋给int变量..任何人都应该对此有所了解
答案 0 :(得分:1)
int value = 0;
int.tryParse(DataTable.Rows[0][0].ToString(), out value);
答案 1 :(得分:0)
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;
}
}