Ryan Minor

Ryan Minor

  • NA
  • 12
  • 0

DataRow and Int.Parse

Aug 6 2009 9:18 AM
Say you populate a DataSet via OLE, and then create a DataTable DataTable dtSomeTable = dsSet.Tables["tblSomeTable"]; and then you get a row DataRow drFirstRow = dtCorporateDetails.Rows[0]; and then you are trying to extract an integer out of the row int someint = int.Parse(drFirstRow["somedata"].ToString()); Is this the best way to get an integer? Is there a way to test that the drFirstRow["somedata"] contains a valid integer without using a try {} and catch {} block?

Answers (1)