Question about navigating a recordset in vb.net 2005

M

Markei54545

Hi all,

I have a very simple form in vb.net 2005. It has a few data bound
fields (created by dragging fields over from the data sources
explorer) and has created the following on the form..

dataset
Bindingsource
TableAdaptor
BindingNavigator

The navigator object has arrow buttons on it to go to the next record,
last record etc.

I just want know, how can I programatically get the screen to flick to
the next record, rather than clicking on the arrow.

Hope that makes sense.

Mark
 
O

Onur Güzel

Hi all,

I have a very simple form in vb.net 2005. It has a few data bound
fields (created by dragging fields over from the data sources
explorer) and has created the following on the form..

dataset
Bindingsource
TableAdaptor
BindingNavigator

The navigator object has arrow buttons on it to go to the next record,
last record etc.

I just want know, how can I programatically get the screen to flick to
the next record, rather than clicking on the arrow.

Hope that makes sense.

Mark

Actually, the bindingsource object provides "position" property and
makes easy to navigate to next record just by specifying position
index. So, i would:

' Move next record
Me.myBindingSource.Position += 1
' Assuming "myBindingSource" is your bindingsource object.

or just use ' MoveNext method

Me.myBindingSource.MoveNext()

' For last record
Me.InstructorsBindingSource.MoveLast()

....MoveFirst and MovePrevious are also available.

HTH,

Onur
 
C

Cor

Be aware that you for sure not are using a recordset. A recordset is a class
from Ado or/and Dao.

The bindingnavigator does not function with a recordset, it uses mostly a
datatable.

Success

Cor

"Markei54545" wrote in message

Hi all,

I have a very simple form in vb.net 2005. It has a few data bound
fields (created by dragging fields over from the data sources
explorer) and has created the following on the form..

dataset
Bindingsource
TableAdaptor
BindingNavigator

The navigator object has arrow buttons on it to go to the next record,
last record etc.

I just want know, how can I programatically get the screen to flick to
the next record, rather than clicking on the arrow.

Hope that makes sense.

Mark
 

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

Top