Events Capturing in Untyped Dataset

G

Guest

Hi,
Hope somebody can help me with this.

I have a Dataset and BindingManagerBase declared :-
********************************************
Private dsData As DataSet
Private bmData As BindingManagerBase
********************************************

The dsData is fill by an oledbadapter upon the form load:-
******************************************
strSQL = "SELECT * FROM tblWarehouse"
dbAdapter.SelectCommand = New OleDbCommand(strSQL ,cn)
dsData = New DataSet
dbAdapter.Fill(dsData, "tblWarehouse")
******************************************

Subsequently, I have my form's controls bound to the dataset:-
*******************************************************
txtWhseID.DataBindings.Add("Text", dsData, "tblWarehouse.strWarehouseID")
cboWhseType.DataBindings.Add("Text", dsData, "tblWarehouse.strType")
bmData = Me.BindingContext(dsData, "tblWarehouse")
*******************************************************

Currently, I can navigate the dataset by manipulate the bmData:-
************************************************
bmData.Position = 0 '(Go to First Record)
bmData.Position -= 1 '(Go to Previous Record)
************************************************

Now, I would like to add in the record indicator into my Form:- Record 3 of 10

The easiest way, is to capture the event when the dataset move from one
record to another or when a record in the dataset is deleted or added.
Example :
Private Sub dsData_Move()
' Calculate the current record position and update result to form display
end sub


Anyone help ?
 

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