Advanced Tutorial

Posts   
 
    
Posts: 28
Joined: 27-Mar-2007
# Posted on: 27-Mar-2007 11:29:37   

Hi, I read Frans Bouma's Blog on using LLBLGenPro datasource control with generated code. Being lazy I used cut and paste to copy the code into project files. I found that there are several errors in the code which distracted me from the tutorials main aim. No code solutions are fine if the problem is simple and there are no errors. Unfortunately, the real world, things are not as simple and being human developers do make mistakes. With no code, error tracking can be tough walking through other peoples code without detailed understanding of the underlying structure. I found the following problems with the tutorial:- 1. Inexplicable none display problems with Gridview and LLBLGenPro datasource. MS SQLDatasource and grid seemed to work together better. 2. Adding the extension to CustomerEntiry partical class resulted in errors to do with Fields element. Adding EntityBase2 only produced further errors to do with not implementing other abstract methods. 3. The final HTML page used for paging does not conform to XHTML 1.0

Sorry to whinge, but I've spent time looking at the use of this products as against developing our own layer. It's a good system but does have some issues.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 27-Mar-2007 12:01:42   

mdmasonmbcs wrote:

Hi, I read Frans Bouma's Blog on using LLBLGenPro datasource control with generated code. Being lazy I used cut and paste to copy the code into project files. I found that there are several errors in the code which distracted me from the tutorials main aim. No code solutions are fine if the problem is simple and there are no errors. Unfortunately, the real world, things are not as simple and being human developers do make mistakes. With no code, error tracking can be tough walking through other peoples code without detailed understanding of the underlying structure. I found the following problems with the tutorial:-

The post wasn't a tutorial per se, it was a posting about what the datasourcecontrol could do. You copy/pasted code, which might have resulted into a mistake somewhere.

  1. Inexplicable none display problems with Gridview and LLBLGenPro datasource. MS SQLDatasource and grid seemed to work together better.

Well, it works here, so I can't help you without your own code.

  1. Adding the extension to CustomerEntiry partical class resulted in errors to do with Fields element. Adding EntityBase2 only produced further errors to do with not implementing other abstract methods.

What kind of errors exactly? We can't help you if you don't paste the errors here.

  1. The final HTML page used for paging does not conform to XHTML 1.0

I'm sorry, but that wasn't the intention. I'm sure the HTML violated some kind of standard or had the wrong doctype according to some people. I fail to see why it's LLBLGen Pro's job to comply to some XHTML 1.x standard if it doesn't do anything with HTML generation at all.

The post you refer to was a showcase how stuff which was presented by Scott Guthrie as 'Linq features' could be done with LLBLGen Pro today. That's it. I still think that if you followed all the steps to the letter it should result in a working app.

Sorry to whinge, but I've spent time looking at the use of this products as against developing our own layer. It's a good system but does have some issues.

Sorry to have dissapointed you, but could you answer to me why you would judge our massive feature set based on your copy/paste work which didn't succeed? Have you followed the steps to the letter or have you just copy/paste some code over and that didn't work and you then concluded our work wasn't good enough?

And, have you for example looked at our big ASP.NET example HnD (which is this forum system)? http://www.llblgen.com/hnd This forum system is provided in full sourcecode as an example how to use LLBLGen Pro in an ASP.NET environment.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 28
Joined: 27-Mar-2007
# Posted on: 11-Oct-2007 12:12:46   

Hi Ottis My most humble apologies if I caused offence. My aim was to go through the tutorial as a first pass at using LLBLGen Pro. Having now used this product for several months, my first impressions seemed naïve. It is a very well thought out product and has some great features. I sometime get stuck when trying to translate from raw SQL to entities and relations. Currently I’m figuring out this

select MediaID, C_MediaID
from
(
select m.media_id as MediaID, content_media_id as C_MediaID
from Media m
left join ContentMedia c
on m.media_id = c.media_id
) d
where C_MediaID is null

Thanking you for your patience

Michael Mason

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 11-Oct-2007 13:11:53   

select MediaID, C_MediaID from ( select m.media_id as MediaID, content_media_id as C_MediaID from Media m left join ContentMedia c on m.media_id = c.media_id ) d where C_MediaID is null

I think there is no need for the second field in the outer select, since it would always be NULL.

By the above query I think you want to on ly get all MediaIDs which are not referenced by rows in ContentMedia, right?

This can also be achieved by the following Query:

SELECT MediaID FROM Media 
WHERE MediaID NOT IN (SELECT MediaID FROM ContentMedia)

Which can be implemented using a FieldCompareSetPredicate. Please consult the LLBLGen Pro manual: Using the generated code -> Adapter/SelfServicing -> Filtering and sorting -> The predicate system

Posts: 28
Joined: 27-Mar-2007
# Posted on: 30-Oct-2007 12:37:08   

Walaa, This seems much simpler. Thanks, I'll give it a go.

Michael Mason

briankb
User
Posts: 51
Joined: 03-Jun-2007
# Posted on: 09-May-2008 08:20:40   

I was trying to do the tutorial, sticking to VB which is what I use everyday.

http://weblogs.asp.net/fbouma/archive/2006/06/09/LLBLGen-Pro-v2.0-with-ASP.NET-2.0.aspx

new SortExpression(CustomerFields.CompanyName | SortOperator.Ascending);

the above snippet does't seem to work in VB for me which I typed as:

Imports System
Imports Northwind.EntityClasses
Imports Northwind.HelperClasses
Imports SD.LLBLGen.Pro.ORMSupportClasses

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            _customerDS.FilterToUse = New RelationPredicateBucket(CustomersFields.Country = "USA")
            _customerDS.SorterToUse = New SortExpression(CustomerFields.CompanyName | SortOperator.Ascending)
        End If
    End Sub
End Class

it works fine except the second line

_customerDS.SorterToUse = New SortExpression(CustomerFields.CompanyName | SortOperator.Ascending)

What am I doing wrong?

Nevermind I need to pay better attention:

_customerDS.SorterToUse = New SortExpression(CustomerFields.CompanyName OR SortOperator.Ascending)