我这样测试没问题
If Relations.Contains("test") Then
Relations.Delete("test")
End If
Dim ParentCol As DataCol = DataTables("表A").DataCols("第二列")
Dim ChildCol As DataCol = DataTables("表B").DataCols("第二列")
Relations.Add("test",ParentCol,ChildCol,True,RelationPathEnum.One)
If Tables.Contains("表A.表B") Then
Dim tbl As WinForm.Table
tbl = e.Form.CreateTable("Table1", "表a.表B", False)
tbl.Dock = System.Windows.Forms.DockStyle.Fill
Dim sp1 As WinForm.SplitContainer = e.Form.Controls("SplitContainer1")
sp1.Panel2.AddControl(tbl)
Else
MessageBox.Show("没有个人档案表")
End If