Hi,
I'm working with VS2008 & Linq and I would like to insert a line into my table called ISAMEMBEROF. The problem is that the primary key (IMO_ID) must be generated automatically (varchar 36). Here is the code that I wrote :
CODE
Dim msg1 As Integer = USRDataGridView.CurrentCell.RowIndex
Dim msg2 As Integer = GROUPDataGridView.CurrentCell.RowIndex
' Create a new object.
Dim ord As New ISAMEMBEROF With _
{.USR_SID = USRDataGridView.Rows(msg1).Cells(0).Value, _
.GRP_GID = USRDataGridView.Rows(msg2).Cells(0).Value, _
.IMO_ID = ???}
' Add the new object to the collection.
Me.Db.ISAMEMBEROFs.InsertOnSubmit(ord)
' Submit the change to the database.
Try
Db.SubmitChanges()
Catch except As Exception
Console.WriteLine(except)
Db.SubmitChanges()
End Try
The SQL equivalent would be :
CODE
insert into ISAMEMBEROF (IMO_ID, USR_SID, GRP_GID) values (default, ..........)
How to do to get this with VB.NET/Linq ?
TIA
Etienne