Hi there, I'm kind of stumped with what I would think should be very straight forward.
When I try to edit and save some data in my datagrid I get a format exception error, seems funny because I can insert and save a new record but when I try to edit save by clicking the save icon on the binding navigator I get this
'Format exception unhandled':
{"@p7 : SMITH - Input string was not in a correct format."}
JUST to be clear I'm not touching the "SMITH" part i'm just changing some address or phone number details in another column.
AND Also I can open the table in "DataBase Explorer>Show table data" and edit save any row/column without issue?.
So why does it happen at runtime?
I wonder is it a bad idea to use a nvarchar() as a foreign key? Is it preferable to use char() ?
CUSTOMERID (SMITH) is defined as a NVARCHAR(5) UNIQUE YES, PRIMARY KEY NO,ALLOW NULS NO.
it is also the foreign key to a child table called ORDERS which i can insert and edit save with no probs.
THE VB CODE TO UPDATE THE DB IS RIGHT OUT OF THE BOX:
Private Sub CustomerTableBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles CustomerTableBindingNavigatorSaveItem.Click
Me.Validate()
Me.CustomerTableBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CustomerWorkDataSet)
End Sub
Any suggestions here would be welcome many thanks for reading :)