The code blow works... sort of. It will only display the first row of data provided. Any number of rows past that it will display only the second one. When I tried to use the .Count function, it only will ever see one row (the Count() sub returns "Currently viewing record 1 of 1"). I have tried up to 5 rows and still only the second one will display. If I got back to one row, it will display that first row. When I added a datagrid to the form, it populated just fine with all the data. Not sure whats going on here.
Code:
Private Sub Connection()
DbConnCC = New OleDbConnection(connectString)
DbAdaptCC = New OleDbDataAdapter(querySQL, connectString)
Try
Fill and close data connection.
DbAdaptCC.Fill(DbDataCC)
Create databindings.
ckspouse.DataBindings.Add("Checked", DbDataCC, "table.ccspouseck")
lastname.DataBindings.Add("text", DbDataCC, "table.cclast")
firstname.DataBindings.Add("text", DbDataCC, "table.ccfirst")
spousename.DataBindings.Add("text", DbDataCC, "table.ccspouse")
familyname.DataBindings.Add("text", DbDataCC, "table.ccfamily")
address.DataBindings.Add("text", DbDataCC, "table.ccaddress")
city.DataBindings.Add("text", DbDataCC, "table.cccity")
state.DataBindings.Add("text", DbDataCC, "table.ccstate")
zipcode.DataBindings.Add("text", DbDataCC, "table.cczip")
emailadd1.DataBindings.Add("text", DbDataCC, "table.ccemail1")
emailadd2.DataBindings.Add("text", DbDataCC, "table.ccemail2")
homephone.DataBindings.Add("text", DbDataCC, "table.cchphone")
cellphone1.DataBindings.Add("text", DbDataCC, "table.cccphone1")
cellphone2.DataBindings.Add("text", DbDataCC, "table.cccphone2")
workphone.DataBindings.Add("text", DbDataCC, "table.ccwphone")
Catch Oledb As OleDbException Catches Database errors seperately
MsgBox(Oledb.Message)
Catch ex As Exception Catches other exceptions seperately
MsgBox(ex.Message)
End Try
End Sub
Private Sub Count()
Records = Me.BindingContext(DbDataCC).Count
Current = Me.BindingContext(DbDataCC).Position + 1
recordcounter.Text = "Now Viewing record " & Current.ToString & _
" of " & Records.ToString
End Sub