Hello,
I am creating a new record using LINQ as follows:
<DataObjectMeth odAttribute(Dat aObjectMethodTy pe.Insert, True)_
Public Shared Sub Insert(ByVal Text As String)
Dim database As New CodeDataContext
Dim tag As New Tag
tag.Text = Text
database.Tags.I nsertOnSubmit(t ag)
database.Submit Changes()
End Sub ' Insert
How do I get the ID of the record inserted?
The ID is created inside the database using New ID and is a Guid.
Thanks,
Miguel
I am creating a new record using LINQ as follows:
<DataObjectMeth odAttribute(Dat aObjectMethodTy pe.Insert, True)_
Public Shared Sub Insert(ByVal Text As String)
Dim database As New CodeDataContext
Dim tag As New Tag
tag.Text = Text
database.Tags.I nsertOnSubmit(t ag)
database.Submit Changes()
End Sub ' Insert
How do I get the ID of the record inserted?
The ID is created inside the database using New ID and is a Guid.
Thanks,
Miguel