S
Shane Brodie
I'm new to .Net, but have 8+ years using VB. I'm having a problem using
data binding in a windows Forms project.
The scenario:
I have a simple form with a series of text boxes and associated labels for
containing input which all goes into the same table. In addition there is a
ComboBox control.
I have 2 data adapters and 2 datasets. One data adapter dataset pair is
bound to a single table and all text boxes are bound to the desired fields
in the dataset. The second dataset is bound to the listbox and is used only
to provide a lookup table (In this case a listing of states and provinces).
The SelectedValue property is also bound to dataset1.
The form displays fine, the listbox populates fine. Any entries made into
the textboxes on the form appear to be ignored. Following is the code from
the cmdOkay button:
dsCompany.GetChanges()
If dsCompany.HasChanges Then
Try
'according to any examples I have found, I need only execute the
following 3 statements
'bata-binding is supposed to be a 2-way process
Me.sqlCN.Open()
Me.daDealerCompany.Update(dsCompany, "tblDealerCompany")
Me.sqlCN.Close()
Catch adoEx As OleDb.OleDbException
Dim strMessage As String
strMessage = "ADO Error: " & adoEx.ErrorCode & vbCrLf & _
adoEx.Message
MsgBox(strMessage)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Me.Hide()
Any help is greatly appreciated.
Shane Brodie
data binding in a windows Forms project.
The scenario:
I have a simple form with a series of text boxes and associated labels for
containing input which all goes into the same table. In addition there is a
ComboBox control.
I have 2 data adapters and 2 datasets. One data adapter dataset pair is
bound to a single table and all text boxes are bound to the desired fields
in the dataset. The second dataset is bound to the listbox and is used only
to provide a lookup table (In this case a listing of states and provinces).
The SelectedValue property is also bound to dataset1.
The form displays fine, the listbox populates fine. Any entries made into
the textboxes on the form appear to be ignored. Following is the code from
the cmdOkay button:
dsCompany.GetChanges()
If dsCompany.HasChanges Then
Try
'according to any examples I have found, I need only execute the
following 3 statements
'bata-binding is supposed to be a 2-way process
Me.sqlCN.Open()
Me.daDealerCompany.Update(dsCompany, "tblDealerCompany")
Me.sqlCN.Close()
Catch adoEx As OleDb.OleDbException
Dim strMessage As String
strMessage = "ADO Error: " & adoEx.ErrorCode & vbCrLf & _
adoEx.Message
MsgBox(strMessage)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Me.Hide()
Any help is greatly appreciated.
Shane Brodie