How to convert string to int?
in data table i want to validate one row.of the row have less than or equal zero value to validate it.how to do it.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Midhun TpPosted Sep 25, 2016, 8:21 AM
Do you need to validate a row or column?
You can convert to int as below-
Convert.ToInt32(dt.Rows[0]["colname"].ToString())>0
Tuhin PaulPosted Mar 16, 2023, 2:49 PM
The first row of the DataTable
dt, iterates over its columns and checks if the value in any column is less than or equal to zero. If such a value is found, it throws an exception with an appropriate error message.Tuhin PaulPosted Mar 16, 2023, 2:48 PM
You can validate a row in a DataTable by iterating over the columns of the row and checking if any column's value is less than or equal to zero.
Rajeev KumarPosted Mar 16, 2023, 9:54 AM
Convert.ToInt32(dt.Rows[0]["columnname"].ToString())>0
Kishore ChowdaryPosted Sep 27, 2016, 11:19 AM
RajaPosted Sep 26, 2016, 12:23 AM
Midhun T P
Delpin Susai Raj
Pradeep Shet
Krishna Rajput Singh
Pradeep ShetPosted Sep 25, 2016, 10:26 AM
Delpin Susai RajPosted Sep 25, 2016, 9:38 AM
Krishna Rajput SinghPosted Sep 25, 2016, 8:04 AM