I have a table that has a foreign key category.id
When I dragged the table onto the dbml diagram the field name has been changed to category_id
I have also dragged an INSERT stored procedure onto the dbml diagram
intellisense is happy with category_id in the block below
Using dbContext As DataClassesDataContext = New DataClassesDataContext()
Dim newTemplate As template = New template With {
.name = txtNewTemp.Text,
.category_id = ddlCategory.SelectedValue,
.text = "blank for now"
}
dbContext.templates.InsertOnSubmit(newTemplate)
dbContext.SubmitChanges()
End UsingBut in execution I get an error that
Cannot insert the value NULL into column 'category.id
Please advise