Multiple columns in DataRelation RRS feed

  • Question


    I am VERY new to VB.NET and VS2008 and have what is probably an easily solved problem:

    I am trying to create a DataRelation between 2 tables both of which have the same 2 columns in their primary key.

    I cannot see how I can create the DataRelation with anything other than two single columns.

    Thanks in advance.
    NB I have seen the reply to a similar question using C# but I have even less experience in that so have been unable to translate!
    Tuesday, October 21, 2008 12:17 PM


  • The DataRelation also has other overloads that take DataColumn array's for the parent and child columns.


    Dim parentColumns as DataColumn() = new DataColumn() { parentColumn1, parentColumn2 }

    Dim childColumns as Datacolumn() = new Datacolumn() { childColumn1, childColumn2 }

    Dim relation1 as DataRelation = new DataRelation("relationName", parentColumns, childColumns)



    Tuesday, October 21, 2008 4:09 PM