I've and pretty standard table setup inside a current application while using .internet XSD DataSet and TableAdapter features. My contracts table includes some standard contract information, having a column for that primary department. This column is really a foreign answer to my Departments table, where I keep fundamental department title, id, notes. This really is all setup and functioning during my SQL Server.

After I make use of the XSD tool, I'm able to drag both tables in at the same time also it auto picks up/produces the foreign key I've between both of these tables. This is effective when I am on my small primary page and am viewing contract data.

However, after i visit my administrative page to change the department data. I typically make a move such as this:

Dim dtDepartment As New DepartmentDataTable()
Dim taDepartment As New DepartmentTableAdapter()


However, at this time the best is tossed telling the result that there's an overseas key reference damaged here, I am speculating since i have not have the Contract DataTable filled.

Has anybody experienced this before? I understand I'm able to simply take away the foreign key in the XSD to create things work fine, but getting the extra integrity check there and getting the XSD schema match the SQL schema within the database is great.

You can test turning CheckConstraints off around the DataSet (it's in the qualities), or changing the qualities of this relationship, and alter the important thing to some simple reference - your decision.