K
KBolin
Guest
Hello-
I am currently working on a piece of code (windows Forms in VB (VS 2010)) that is already in production and using bindingnavigator/tableadapter/bindingsource to cycle thru the data (they are using text boxes to display/edit the information) and this seems to work just fine.
Recently they wished to include an add item feature to it as well and while this seemed to be relatively forward I have run into an issue:
Within the Save event I used the following code
-----------------------------------------------------------------------------------------------------------
Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
Save item
Try
Me.Validate()
recordBindingSource.EndEdit()
recordTableAdapter.Update(WISPatruLI_DataDataSet.Record)
MsgBox("Update successful!")
Catch ex As Exception
MsgBox(ex.message)
End Try
End Sub
-----------------------------------------------------------------------------------------------------------
But this continues to throw errors (at recordBindingSource.EndEdit()) related to the guid being Null. I have no control over the DB side of things, outside of just writing a SQL to insert the new record , is there way to overcome this using the above controls ?
Thank you in advance for any help.
Ken
Continue reading...
I am currently working on a piece of code (windows Forms in VB (VS 2010)) that is already in production and using bindingnavigator/tableadapter/bindingsource to cycle thru the data (they are using text boxes to display/edit the information) and this seems to work just fine.
Recently they wished to include an add item feature to it as well and while this seemed to be relatively forward I have run into an issue:
Within the Save event I used the following code
-----------------------------------------------------------------------------------------------------------
Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
Save item
Try
Me.Validate()
recordBindingSource.EndEdit()
recordTableAdapter.Update(WISPatruLI_DataDataSet.Record)
MsgBox("Update successful!")
Catch ex As Exception
MsgBox(ex.message)
End Try
End Sub
-----------------------------------------------------------------------------------------------------------
But this continues to throw errors (at recordBindingSource.EndEdit()) related to the guid being Null. I have no control over the DB side of things, outside of just writing a SQL to insert the new record , is there way to overcome this using the above controls ?
Thank you in advance for any help.
Ken
Continue reading...