user682417
user682417

Reputation: 1518

Retrieving the value from dataTable

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

Answers (2)

Wicked Coder
Wicked Coder

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

Senad Meškin
Senad Meškin

Reputation: 13756

int value = 0;
int.tryParse(DataTable.Rows[0][0].ToString(), out value);

Upvotes: 1

Related Questions