XSD DataSets and also overlooking international keys

I have a rather typical table set up in an existing application making use of the .NET XSD DataSet and also TableAdapter attributes. My contracts table contains some typical contract details, with a column for the primary department. This column is a foreign key to my Departments table, where I store the standard department name, id, notes. This is all arrangement and also operating in my SQL Server.

When I make use of the XSD device, I can drag both tables in simultaneously and also it vehicle detects/creates the international key I have in between these 2 tables. This functions wonderful when I'm on my major web page and also am watching contract information.

Nonetheless, when I most likely to my management web page to change the division information. I commonly do something similar to this:

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

taDepartment.Fill(dtDepartment)

Nonetheless, now an exemption is tossed claiming to the result that there is an international key reference damaged below, I'm presuming given that I do not have the Contract DataTable loaded.

Just how can I repair this trouble? I recognize I can merely remove the international key from the XSD to make points function great, yet having the added honesty check there and also having the XSD schema match the SQL schema in the database behaves.

0
2019-05-06 23:53:31
Source Share
Answers: 1

You can attempt transforming Check-constraints off on the DataSet (it's in its buildings ), or modifying the buildings of that partnership, and also transform the key to a straightforward reference - approximately you.

0
2019-05-07 16:54:23
Source