1
Answer

DataRow and Int.Parse

Ask a question
Ryan Minor

Ryan Minor

15y
6.4k
1
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)