How to find DataSet has any values

  • Thread starter Thread starter Gomathi
  • Start date Start date
G

Gomathi

hi all,

In ASP.Net , i'm using a dataset. I want to find whether it has any values
or not. How to do that?

Thanks in advance.

Regards,
Gomathi
 
Hello Gomathi,
here are some example of it. lets say your dataset name is "ds" then,

ds.Tables.Count returns number of tables in dataset
ds.Tables[0].Rows.Count returns number of rows in first tables
ds.Tables[0].Rows[0][0] return value of first table's first row's first column.


Mihir Solanki
http://www.mihirsolanki.com
 
Gomathi,
You can find it using rows count. Using below code you can find the
dataset has values or not
DataSet dsEmp= new DataSet("Employees");
int intCount = dsEmp.Tables[0].Rows.Count;
 
Back
Top