A TableRow referenced trought a DataRelation always returns null

315 views Asked by At

Using the DataSet designer in Visual Studio 2010, I've added some tables from a MySql DB. VS10 automatically picks up and adds the relations between the tables, e.g., the relation "FK_organisatie_adres" between the tables "Organisatie" and "Adres": VS DataSet designer with 2 table and relationship

In the C# code, a property was automatically generated that "resolves" that relationship: a row of Organisatie has a property .adresRow (I assume through the detected relation "FK_organisatie_adres") VS auto generated property to get the related adresRow

Problem: when running the code, the "theAddress" (hence the .adresRow property) is ALWAYS null!

Also the "theOrganisationRow.GetChildRows("FK_organisatie_adres")" always return null. and the "organisationDT.ChildRelations" is empty.

What am I doing wrong? What do I need to do extra before I can use the automatically generate .adresRow property?

0

There are 0 answers