Hi, I thought you could do this with linq, but it always throws a foreign key error and the ContactType.id is 0. Is it necessary to call SubmitChanges after inserting the new ContactType, or am I missing something basic?
Dim ct As New ContactType
ct.name = "supervisor"
db.ContactTypes.InsertOnSubmit(ct)
Dim c As New Contact
c.ContactTypeId = ct.id
c.first_name = "fname"
c.last_name = "lname"
db.contacts.InsertOnSubmit(c)
db.SubmitChanges()