How is the identity of the inserted row accessed after using a AddNew?
Code below inserts aok, but when I try to access in this case _order.OrderID it is NULL after the insert.
Does the AddNew update the Object?? My VistaDB has the OrderID set to have a default value of newid() and is the Primary Key..
Code:
Dim _order As New Order
_order.AddNew()
'Create NEW ORDER ID
Dim _CustomerID As System.Guid = New System.Guid(Me.CustomerID)
Dim _SalesRepID As System.Guid = New System.Guid(Common.Values.SalesRepID)
_order.CustomerID = _CustomerID
_order.SalesRepID = _SalesRepID
_order.OrderDate = Now
_order.DateSynced = Nothing
_order.Notes = Me.txtNotes.Text
_order.Signature = Helper.Utils.ConvertImageToByteArray(Me.inkSignature.Image, System.Drawing.Imaging.ImageFormat.Gif)
_order.NexusImport = False
_order.Save()