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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Implementing Interface 1
Panel Control 1
Aligning Datagrid 1
Popup window 2
Global.asax 2
Problem with the DataSET. 1
Winforms - how to access the database 1
Converting Excel to Text 1

Back
Top