TypedView & LLBLGenProDataSource and exception

Posts   
 
    
rparkins
User
Posts: 66
Joined: 04-May-2005
# Posted on: 18-Feb-2008 17:01:24   

Hi

I am having an issue that I cant solve and have looked in the usual places and cant see what I am doing wrong so if anyone can point me in the right direction would be grateful.

I have created a View in SQL EnterpriseManager which contains 2 tables called Contact and Organisation. I have added this to my LLblgen Project (version 2.5 final Nov 5th 2007, Self Servicing) and added the project into my solution. I am using a LLBLGenProDataSource and a gridview and setting the datasourceid of the gridview to the LLBLGenProDataSource.

This is where I get my issue. If I try to filter the View by the Contacts's ID the webpage raises an exception:

The column prefix 'Barton.barton.Contact' does not match with a table name or alias name used in the query.

I am presuming its something to do with the prefix of the table but am not sure why this is failing as I have checked the Fieldname exists in the TypedView and it does.. The filter code I use is as follows:

LLBLGenProDataSource1.FilterToUse = new PredicateExpression(ContactFields.CId == TouchScreenData.Contacts.UserContext.SelectedContact.CId);

Thanks for your help and apologies if this I am missing something obvious rage

Regards

Richard

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 19-Feb-2008 01:42:37   

Could you please post the full stack trace of the exception?

rparkins
User
Posts: 66
Joined: 04-May-2005
# Posted on: 19-Feb-2008 10:39:55   

Hi Goose

I have reverted to a typedlist for now and all is well. I will need to generate a new usercontrol for other parts of the site. I will use a view initially for this and try to replicate the issue, at which point I will post the full stack trace. Does seem strange that typedlist worked but not view. I wondered if it was an issue with the Alias used by llblgen not being recognised and I should have set actual field names in the markup..

Anyway thanks for your reply, I so intend to find out what the issue was really for my own satisfaction as it is the first time I have used Views in my code.

Regards

Richard

goose wrote:

Could you please post the full stack trace of the exception?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-Feb-2008 10:52:32   

LLBLGenProDataSource1.FilterToUse = new PredicateExpression(ContactFields.CId == TouchScreenData.Contacts.UserContext.SelectedContact.CId);

I think the issue is in the above filter, I guess you are using the entity fields enum ContactFields rather than the TypedView one. You should find something like MyTypedView.CId to use instead.