I need some help!!!
I have been working on this for hours/days and can't seem
to get this to work or even get an understanding as
to what is needed to make it work. I have looked at
many a examples but none that shows what I am doing.
I have an windows form application, my database is
an Access database with 2 tables (WedMst and WedLoc),
I am using OleDB Jet connection and 2 OleDb data adapters
(daWedMst and daWedLoc), one for each of my tables and
a data set (dsWedding).
Everything works when I only set up one table(WedMst), I
can scan through the table. When I add a data relation ,
it will only display the first row.
I have tried to create a currency manager but that just gives
me an unhandled exception error.
What am I doing wrong?
Is there a better way?
Should I be using SQL commands? I assume I can by the
fact that the data adapter created statements?
Thanks for your help...
Dim bmWedMst As BindingManagerBase
Private cmWedding As CurrencyManager
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
'[Load the database]
Try
daWedMst.Fill(dsWedding)
Catch eLoad As System.Exception
MessageBox.Show(eLoad.Message)
End Try
'[Load the database/]
'[Load the database]
Try
daWedLoc.Fill(dsWedding)
Catch eLoad As System.Exception
MessageBox.Show(eLoad.Message)
End Try
'[Load the database/]
dsWedding.Relations.Add("relMstToLoc", _
dsWedding.Tables("WedMst").Columns("fldWedMstID"), _
dsWedding.Tables("WedLoc").Columns("fldWedLocID"))
bmWedMst = Me.BindingContext(dsWedding, "WedMst.relMstToLoc")
' This next line works
'bmWedMst = Me.BindingContext(dsWedding, "WedMst")
cmWedding = CType(Me.BindingContext(bmWedMst, "relMstToLoc"), _
CurrencyManager)
End Sub
Private Sub lblNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles lblNext.Click
bmWedMst.Position += 1
' This next line works to display a specific row
'bmWedMst.Position = 3
End Sub