Home All Groups Group Topic Archive Search About

Help get record count and moving forward and backwards!

Author
14 Feb 2006 4:39 PM
Adrian
Hi

I'm lost! so please help me...

I have the following code

I want to simply retrieve all the record that matches the SQL statement, I
want to know how many records matched and display only one field adata from
each match but also be able to step forward and backwards?!

Dim myConnection As MySqlConnection

Dim myDataAdapter As MySqlDataAdapter

Dim myDataSet As DataSet

Dim mySelectQuery As String = "SELECT aData FROM mydb.test where myNumber
like '%" & txtNum.Text & "%'"

Dim strSQL As String

Dim iRecordCount As Integer

myConnection = New MySqlConnection("server=localhost; user id=root;
password=password; database=mydb")

strSQL = mySelectQuery

myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)

myDataSet = New DataSet

myDataAdapter.Fill(myDataSet, "mydb.test ")

MsgBox(myDataSet.ExtendedProperties.Count.ToString)

Author
15 Feb 2006 3:25 AM
Ken Tucker [MVP]
Hi,

MsgBox(myDataSet.Tables("mydb.test").rows.Count.ToString)

Ken
--------------
Show quoteHide quote
"Adrian" <Adrian@nospamhotmail.com.uk> wrote in message
news:dst13q$6ns$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
> Hi
>
> I'm lost! so please help me...
>
> I have the following code
>
> I want to simply retrieve all the record that matches the SQL statement, I
> want to know how many records matched and display only one field adata
> from each match but also be able to step forward and backwards?!
>
> Dim myConnection As MySqlConnection
>
> Dim myDataAdapter As MySqlDataAdapter
>
> Dim myDataSet As DataSet
>
> Dim mySelectQuery As String = "SELECT aData FROM mydb.test where myNumber
> like '%" & txtNum.Text & "%'"
>
> Dim strSQL As String
>
> Dim iRecordCount As Integer
>
> myConnection = New MySqlConnection("server=localhost; user id=root;
> password=password; database=mydb")
>
> strSQL = mySelectQuery
>
> myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
>
> myDataSet = New DataSet
>
> myDataAdapter.Fill(myDataSet, "mydb.test ")
>
> MsgBox(myDataSet.ExtendedProperties.Count.ToString)
>
>