Empty loadopration when calling "load" method

1 posts, 0 answers
  1. mohammad
    mohammad avatar
    2 posts
    Member since:
    Jan 2011

    Posted 02 Jan 2011 Link to this post

    HI
    when use this code:

    Public subGetPerson() 
                 DbPerson.Load(Of TBLPersons1)(DbPerson.GetTBLPersons1Query.Where  (Function(q) q.PERSONNO = _PersonNo), AddressOf ComplateGetPerson, Nothing)
    End sub
      Public Sub ComplateGetPerson(ByVal lo As LoadOperation)
          _dsPersons.Clear()
          For Each dr In lo.Entities
              _dsPersons.Add(dr)
          Next
          If _dsPersons.Count > 0 Then
              FullNameSelectPerson = _dsPersons.First.FIRSTNAME & " " & _dsPersons.First.LASTNAME & " in " & _dsPersons.First.VAHED
          Else
              FullNameSelectPerson = ""
          End If
      End Sub

    loadopration Loaded
    but when use this code:
    Public Function GetPerson() As Boolean
            Dim Person As New TBLPersons1
            Dim LO As LoadOperation(Of TBLPersons1) = DbPerson.Load(Of TBLPersons1)(DbPerson.GetTBLPersons1Query.Where(Function(q) q.PERSONNO = _PersonNo)) 
    _dsPersons.Clear()
           For Each dr In LO.Entities
               _dsPersons.Add(dr)
           Next
           If _dsPersons.Count > 0 Then
               FullNameSelectPerson = _dsPersons.First.FIRSTNAME & " " & _dsPersons.First.LASTNAME & " In " & _dsPersons.First.VAHED
               Return True
           Else
               FullNameSelectPerson = ""
                Return False
            End If
        End Function

    LO is Empty.

    plz help me


Back to Top