TypedView .Fill - code not generated v3.0

Posts   
 
    
bobperritt
User
Posts: 14
Joined: 05-Aug-2004
# Posted on: 19-Jul-2010 05:15:50   

Self-service, typed view from a stored procedure that returns 2 result sets. The .FILL() code is not being generated by the designer, the only entry is:

''' <summary>Fills itself With data obtained From the resultset this typedview Is mapped On.</summary> ''' <param name="transactionToUse">The transaction To use.</param> ''' <returns>True If fill succeeded, False otherwise</returns> Public Function Fill(transactionToUse As ITransaction) As Boolean Dim toReturn As Boolean Using query As IRetrievalQuery = RetrievalProcedures.GetQueryForUMT_InvoiceDetailRowTypedView() toReturn = New TypedListDAO().GetMultiAsDataTable(GetFields(), Me, query, transactionToUse) End Using Return toReturn End Function

no other entries / overloads exist.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 19-Jul-2010 06:16:36   

It works for me. So after calling that .Fill the typedView is still empty?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 19-Jul-2010 12:08:31   

In these kind of cases, attach the llblgenproj file (here or in a helpdesk forum thread).

Frans Bouma | Lead developer LLBLGen Pro
bobperritt
User
Posts: 14
Joined: 05-Aug-2004
# Posted on: 19-Jul-2010 22:54:27   

Can't use .fill() overrides - creates a vb error.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Jul-2010 05:53:39   

You have two TypedViews mapped on two Stored procedure calls. Both generates a Fill method in the generated code. What is the VB error you get?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Jul-2010 12:26:26   

A typedview is a single set, so if your proc returns 2 sets, you can map a typedview on only one of them. if you want both sets, you have to map a typedview on each resultset and fetch them separately, as the focus is on the typedview: you fetch a typed view, and to do that you call a stored proc.

To fetch both sets, use the v2.x system, simply call the proc and receive a dataset.

So it's a little unclear what exactly you're doing and what's going wrong as your post is light on details.

Frans Bouma | Lead developer LLBLGen Pro
bobperritt
User
Posts: 14
Joined: 05-Aug-2004
# Posted on: 20-Jul-2010 13:44:40   

Ok - good. Now, using the generated code try to fill the typed view. You are unable to specify a filter or sort expression. That code is missing from the generated code for typed views. Can't FILL the view.

The LLBL project I sent you failed to refresh from the database last night - the LLBL project became corrupt returning unhandled errors. Great. So I had to fall back on a previous version and rewrote it to use stored procedures returning 1 resultset only. I then created a simple, 1 page ASPX page solution so you could see the error. It should be attached as a ZIP file.

Go to the default.aspx.vb code page, and try to code tv.fill(.....) with filters and sorters.

Attachments
Filename File size Added on Approval
Default.aspx.vb 628 20-Jul-2010 13:46.02 Approved
bobperritt
User
Posts: 14
Joined: 05-Aug-2004
# Posted on: 20-Jul-2010 13:48:34   

Solution to large to upload, so I sent the LLBL file and the code file. Let me know if you want the whole solution.

FYI - the SQL Server = 2008 R2 x64. Solution = VS2010

bobperritt
User
Posts: 14
Joined: 05-Aug-2004
# Posted on: 20-Jul-2010 13:52:20   

Just to be clear. The following is from your documentation for the LLBL framework, Using Generated Code, SelfServicing, Using TypedViews...

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

This is what I want to do, but the generated code from LLBL does not have the a function over-ride with these parameters.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Jul-2010 14:53:49   

That of course doesn't work, as your typedview is mapped on a stored procedure resultset, so you have to follow that code, pass parameters to the proc to fetch the typedview, if there's no filter specified INSIDE the proc based on a parameter, then the typedview isn't filtered.

If you want to filter a typedview based on a predicate, map it onto a table or view.

Frans Bouma | Lead developer LLBLGen Pro
bobperritt
User
Posts: 14
Joined: 05-Aug-2004
# Posted on: 20-Jul-2010 16:37:11   

understood. thank your for your help. I re-read the documentation on the LLBL Framework and now see the section on typed views from stored procedures. I'm sure that section wasn't there yesterday flushed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Jul-2010 16:49:34   

bobperritt wrote:

understood. thank your for your help. I re-read the documentation on the LLBL Framework and now see the section on typed views from stored procedures. I'm sure that section wasn't there yesterday flushed

Heh wink , yeah, sometimes sections magically appear and disappear, must be the weather wink

Frans Bouma | Lead developer LLBLGen Pro