Fill method on a Typed View

Posts   
 
    
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 04-Oct-2007 15:38:46   

Dim invoices As New InvoicesTypedView() Dim invoicesFilter as IPredicateExpression = New PredicateExpression( _ New FieldCompareValuePredicate(InvoicesFields.OrderID, ComparisonOperator.GreaterThan, 11000)) invoices.Fill(0, Nothing, True, invoicesFilter)

When i try to use this example..its says that Fill is not a method? Any reason..this is straight from the help manual

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 04-Oct-2007 15:44:07   

Most probably you have generated the code according to the Adapter template set not the selfServicing template set.

The example you have posted if for SelfServicing, the corresponding example for Adapter is:

InvoicesTypedView invoices = new InvoicesTypedView(); DataAccessAdapter adapter = new DataAccessAdapter(); RelationPredicateBucket bucket = new RelationPredicateBucket(); bucket.PredicateExpression.Add(InvoicesFields.OrderId > 11000); adapter.FetchTypedView(invoices.GetFieldsInfo(), invoices, bucket, true);

Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 04-Oct-2007 16:02:50   

thanks..it appears to work but fails when i execute the writexml part..i get error 'empty path name is not legal'

    Dim oNotes As New VwCallsTypedView()
    Dim adapter As New DataAccessAdapter()
    Dim sNotesXML As String = String.Empty
    Try

        adapter.FetchTypedView(oNotes.GetFieldsInfo(), oNotes)
        oNotes.WriteXml(sNotesXML) **ERROR
        Return sNotesXML
    Catch ex As Exception
        Return ""
    Finally
        adapter.Dispose()
    End Try
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Oct-2007 15:26:57   

Would you please post the complete exception text and stack trace?