Re: Counting records in a dataset



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.

"Jim Campau" <jim_campau@xxxxxxxxxx> wrote in message
news:eJ4Ko25iFHA.1372@xxxxxxxxxxxxxxxxxxxxxxx


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





.



Relevant Pages

  • Re: Dataset (ASP.net) has two datatables. is this normal?
    ... > Is it common to see two datatables within a dataset? ... > to "dbo" and the other belongs to the user who will be accessing the page. ... > TIA, Randy ... Prev by Date: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Joins with Datatables
    ... but you can use a DataRelation between them and work with it that way as ... > intention of being able to work of disconnected way (datatables, schema, ... Prev by Date: ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataTables
    ... > I have two DataTables with same schema ... aren't compatible rows in the second table. ... Reporting tool: http://www.neodatatype.net ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Best practice for showing data from diferent queries in same form
    ... Can you cache them in memory as datatables then do a random selection? ... Prev by Date: ...
    (microsoft.public.dotnet.framework.aspnet)