Counting records in a dataset

  • Thread starter Thread starter Jim Campau
  • Start date Start date
J

Jim Campau

I am trying to count the number of records in a dataset (ChangeOverDataset1)
and have the results post to a textbox (txtResult). I have tried a few
different way to get this to work but I don't know how. I am a newbie.
Please help.

Thanks in Advance,

========================================

ChangeOverDataSet1.Clear()

OdbcDataAdapter1.Fill(ChangeOverDataSet1)

Dim Command As Odbc.OdbcCommand = New Odbc.OdbcCommand("SELECT COUNT(*) FROM
ChangeOverDataSet1", OdbcConnection1)

txtResult = Command
 
Datasets don't contain any records. It's the datatables inside the datasets
that contain records. So, if you want to know the number of records in the
first datatable, use DataSet.Tables[0].Rows.Count property (after filling
the dataset).

HTH.



I am trying to count the number of records in a dataset (ChangeOverDataset1)
and have the results post to a textbox (txtResult). I have tried a few
different way to get this to work but I don't know how. I am a newbie.
Please help.

Thanks in Advance,

========================================

ChangeOverDataSet1.Clear()

OdbcDataAdapter1.Fill(ChangeOverDataSet1)

Dim Command As Odbc.OdbcCommand = New Odbc.OdbcCommand("SELECT COUNT(*) FROM
ChangeOverDataSet1", OdbcConnection1)

txtResult = Command
 

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

Back
Top