K
Kevin Hodgson
Hoping someone can provide some insight into what I'm doing wrong here.
I have a Win.Form with a bunch of text controls, bound to a Dataset
(DsCustomerInfo1), and a ComboBox bound to the ClientID Field of that
Dataset (DsCustomerInfo1.cw_clientinfo.ClientID) so that I can select a
client ID, and get all the text boxes filled with data for the selected
client. That all works beautifully.
I edit the address field for instance, and hit my Update Client Button.
Private Sub btnUpdateClient_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUpdateClient.Click
Me.connExpress.Open() 'Open the connection
Try
Debug.Assert(Me.DsCustomerInfo1.HasChanges, "No Changes Present")
Me.daCustomerInfo.Update(Me.DsCustomerInfo1, "CW_customerinfo")
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Critical, "SQL Error")
End Try
Me.connExpress.Close() 'Close the connection
End Sub
The Assert says that there are no changed Rows.
I have a breakpoint on the daCustomerInfo.Update line, and I have a watch on
CType(CType(DsCustomerInfo1.cw_customerinfo.rowCollection.Item(0),System.Dat
a.DataRow),SupportTool.dsCustomerInfo.CW_customerinfoRow) Which is the row
I'm changing.
The Address field shows my new edited address, but the Rowstate property is
Unchanged.
I can select a new client from the Combobox, and come back to this one, and
my new edited address is still displayed, but it hasn't been reflected back
to the SQL Database. If I log out of the application and come back in, I'm
back to my original address as stored in the SQL DB.
I have a Win.Form with a bunch of text controls, bound to a Dataset
(DsCustomerInfo1), and a ComboBox bound to the ClientID Field of that
Dataset (DsCustomerInfo1.cw_clientinfo.ClientID) so that I can select a
client ID, and get all the text boxes filled with data for the selected
client. That all works beautifully.
I edit the address field for instance, and hit my Update Client Button.
Private Sub btnUpdateClient_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnUpdateClient.Click
Me.connExpress.Open() 'Open the connection
Try
Debug.Assert(Me.DsCustomerInfo1.HasChanges, "No Changes Present")
Me.daCustomerInfo.Update(Me.DsCustomerInfo1, "CW_customerinfo")
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Critical, "SQL Error")
End Try
Me.connExpress.Close() 'Close the connection
End Sub
The Assert says that there are no changed Rows.
I have a breakpoint on the daCustomerInfo.Update line, and I have a watch on
CType(CType(DsCustomerInfo1.cw_customerinfo.rowCollection.Item(0),System.Dat
a.DataRow),SupportTool.dsCustomerInfo.CW_customerinfoRow) Which is the row
I'm changing.
The Address field shows my new edited address, but the Rowstate property is
Unchanged.
I can select a new client from the Combobox, and come back to this one, and
my new edited address is still displayed, but it hasn't been reflected back
to the SQL Database. If I log out of the application and come back in, I'm
back to my original address as stored in the SQL DB.