Barton

Barton

  • NA
  • 1
  • 0

Foreign Key data access issue .NET 2.0 VS2005

Oct 24 2005 10:03 PM
We're trying to build the data access layer in an N-Tier application and we've hit a bit of a stumbling block. Using the dataset designer we added two tables and their foreign key relationships came with them. I have a sneaking suspicion I'm totally missing the point of how to do this.
Public Class Pants
  Shared _pta As New AwesomeDataSetTableAdapters.PersonTableAdapter
  
  Private _pyle As String
 
  Sub Test()
    Dim pers As AwesomeDataSet.PersonRow
    pers = _pta.GetDataByPersonId(3).FindByPersonId(3)
    _pyle = pers.data.RegionRowByFK_Person_Region.RegionCode
  End Sub
End Class
I just threw that code together off the top of my head, so it could contain errors and such, but hopefully it illustrates what I'm trying to do and what I'm doing wrong. My problem is that _pyle will always contain nothing even though there is a corresponding row in the related table. Exactly how are you supposed to access the row data for a foreign key? Any help would be greatly appreciated! Thanks, Barton