从dataTable检索值

| 如何从dataTable中检索值(字符串形式)并将该值分配给int变量。     
已邀请:
        
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;      
          }
    }
    
        
int value = 0;
int.tryParse(DataTable.Rows[0][0].ToString(), out value);
    

要回复问题请先登录注册