我试图在两个表之间创建关系,(访问)
我的代码:
Dim DataSet1 As New DataSet("DataSet")
DataSet1.Tables.Add(getTable(TableName, con)) 'Returns DataTable
Dim DataRelation1 As DataRelation = New DataRelation(TableName, Column1, Column2, True) ' Execption Here !!!
DataRelation1.Nested = True
DataSet1.Relations.Add(obj_DataRelation)
例外:
Cannot create a DataRelation if Parent or Child Columns are not in a DataSet.
我错过了什么?(是的,但是:/)(示例 C#/VB.net 是最好的答案)