473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Help get record count and moving forward and backwards!


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 )

Feb 24 '06 #1
3 4373
Hello,

In VB.Net there is no more a provision to move forwards and backwards in a
recordset. The most popular method is to retrieve the records in a DataTable
which exposes a DataRowCollection.

You can then access any record in the collection by its index.

Regards
Cyril Gupta
Feb 25 '06 #2
Cyril,

I am curious, the OP is not speaking about a recordset, where you get this?
In my opinion is the answer from Ken the right one about the count.

Getting a datarow in a datatable is just

dim dr as datarow = dt.table(0).Rows(The position index)
By changing the position index you can go get any datarow you want.

(To confuse, there are in the strongly typed dataset against members to do
movenext and moveprevious with a datatable).

Cor

"Cyril Gupta" <no****@nospam.com> schreef in bericht
news:On**************@TK2MSFTNGP12.phx.gbl...
Hello,

In VB.Net there is no more a provision to move forwards and backwards in a
recordset. The most popular method is to retrieve the records in a
DataTable which exposes a DataRowCollection.

You can then access any record in the collection by its index.

Regards
Cyril Gupta

Feb 25 '06 #3
Thanks, but Cor, I don't see a post from "Ken"?!

I didn't want to use a data grid as I don't know how many records it will
return (could in the millions) and don't want to display them in a grid...

If Ken's, missing, post has my answer could someone re post it for me
please!

thanks
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
Cyril,

I am curious, the OP is not speaking about a recordset, where you get this? In my opinion is the answer from Ken the right one about the count.

Getting a datarow in a datatable is just

dim dr as datarow = dt.table(0).Rows(The position index)
By changing the position index you can go get any datarow you want.

(To confuse, there are in the strongly typed dataset against members to do
movenext and moveprevious with a datatable).

Cor

"Cyril Gupta" <no****@nospam.com> schreef in bericht
news:On**************@TK2MSFTNGP12.phx.gbl...
Hello,

In VB.Net there is no more a provision to move forwards and backwards in a recordset. The most popular method is to retrieve the records in a
DataTable which exposes a DataRowCollection.

You can then access any record in the collection by its index.

Regards
Cyril Gupta


Feb 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James P. | last post by:
Hello there, I have a bound-form using Navigator so that the user can move back and forth to update record in the form. Every time a record was modified and the user clicks the Navigator to...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
1
by: LedZep | last post by:
This program has to use a stack to determine whether a string is a palindrome (a string that is spelled identically backward and forward). The program has to ignore spaces, case sensitivity and...
1
by: Adrian | last post by:
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...
0
by: Peter Newman | last post by:
vb.net 2003 Sql 2005 Ive been banging my head against a brick wall for the last day trying to figure out what im doing wrong I have a Dataset and a Form with text boxes that are bound to the...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
4
by: cman | last post by:
What are the issues involved in using pointers to move forward and backward strings and other data types? How do you include effeciency, security and manageability? cman
9
by: TF | last post by:
Hello all, I made a ASP.NET 2.0 site that shows possible "recipes" for paint colors stored in an access dbase. Basically, 1000 colors are stored with specific RGB values in separate columns. A...
6
by: Richard Hollenbeck | last post by:
Thanks to everybody who has helped me to get this thing finally working (somewhat). I got the field names to properly display in the PageHeaderSection, so I won't post the code from that. Now I'm...
15
by: mcjason | last post by:
I saw something interesting about a grid pair puzzle problem that it looks like a machine when you find each that work out the way it does and say with all the others that work out the way they...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.