Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

test if I got something in my Dataset 1

Status
Not open for further replies.

RSX02

Programmer
May 15, 2003
467
0
0
CA
Hi
I have a dataset that I put the data in a datagrid
when I load the form..I'm supposed to see the data in the datagrid..but I don't

I'm trying to know why I don't have data in it...So first of all I want to know if I have data in my dataset
I tried to test it that way:
If m_DataLayer.DsJobType Is Nothing Then
MsgBox("is nothing")
Else
MsgBox("is not nothing")
End If

And It display "Is not nothing" so...That tell me that I have some data in my dataset right?

I would like to know if it's a good way to test it...or if it will return always that it is not = to nothing
 
It looks as if you are testing whether you have instantiated your dataset rather than if there is any data in your dataset. Try getting a count of the rows in the dataset: dataset.rows.count
 
it tell me that Rows is not a member of my dataset??
 
My mistake, I missed out the datatable in my post before.

eg. dataset.datatables(index).rows.count

where index is the index of the datatable of interest - 0 if you only have one datatable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top