|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Variable that holds the record count of a result set?Hello
is there a variable that is available to me that contains the number of rows contained in a dataset return from a database call? have a class that runs a stored proc and returns a dataset/resultset looking to simply assign an integer this value if it is possible i'm using (learning) vb.net thanks again for any help! Hi Simon,
a dataset after it's filled contains one or more tables which you can address like this: DataSet.Tables(0) mostlike the tables contains rows which you can address like this DataSet.Tables(0).Rows(index) and then again the rows have got a count property, what you need. So if you want the know the number of rows contained in a dataset table you can use DataSet.Tables(tableIndex).Rows.Count() Hope this helps Greetz Peter -- Show quoteHide quoteProgramming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook) "simon" <m*@here.com> schreef in bericht news:60krs1l4jo1ugnse4n4ee6vguler5ret3a@4ax.com... > Hello > is there a variable that is available to me that contains the number > of rows contained in a dataset return from a database call? > > have a class that runs a stored proc and returns a dataset/resultset > looking to simply assign an integer this value if it is possible > > i'm using (learning) vb.net > > thanks again for any help! > "simon" <m*@here.com> wrote in message Not for the DataSet itself, but on [each of] the DataTable(s) that itnews:60krs1l4jo1ugnse4n4ee6vguler5ret3a@4ax.com... > is there a variable that is available to me that contains the number > of rows contained in a dataset return from a database call? contains, as in Dim ds as DataSet = GoGetDataAsDataSet() ? ds.Tables( 0 ).Rows HTH, Phill W. If you are using a dataadapter to populate your dataset, the return
value is the number of rows affected: Dim r as integer = MyDataAdapter.Fill(MyDataSet) Debug.Write r.ToString & " rows returned" OR If you just want to know howmany rows there will be, change your stored procedure (have an alternative proc) to do a count rather than return records In message <60krs1l4jo1ugnse4n4ee6vguler5re***@4ax.com>, simon <m*@here.com> writes >Hello >is there a variable that is available to me that contains the number >of rows contained in a dataset return from a database call? > >have a class that runs a stored proc and returns a dataset/resultset >looking to simply assign an integer this value if it is possible > >i'm using (learning) vb.net > >thanks again for any help! > -- Chris Petchey thanks chris. i think this is exactly what i'm looking for.
is it possible to get this count before or after the fill takes place or can does it need to occur while doing the fill? examples are always apprecaited by newbies :-D On Wed, 18 Jan 2006 14:47:30 +0000, Chris Petchey <chr***@soltec.demon.co.uk> wrote: Show quoteHide quote >Dim r as integer = MyDataAdapter.Fill(MyDataSet) >Debug.Write r.ToString & " rows returned"
How do I schedule events for execution ?
How to check datatable.select How do menu list with one check looping through datareader Question on Dataset navigation vb.net Custom Property Using SP_Password with VB.NET but keep getting "old (current) password incorrect for user" LIKE operator question Changing my ProcessName? Disable Datagrid Cell Based On Initial Value |
|||||||||||||||||||||||