Typedview behaving strangely

Posts   
 
    
bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 28-Aug-2006 16:26:50   

Hello,

I have the following typedview which joins on quite a few look up tables

When data binding to this in visual studio 2005 (ASP.net version 2), I'm getting some really strange errors

SELECT TOP (100) PERCENT dbo.t_Mortgage.status, dbo.t_Mortgage.ID, dbo.t_Customer.email, dbo.t_Mortgage.whatpage, dbo.t_Mortgage.qtimestamp, dbo.t_QuoteStatus.Name AS quotestatusname, dbo.t_Customer.firstname, dbo.t_Customer.lastname, dbo.t_Mortgage.nationality, dbo.t_Mortgage.phone, dbo.t_Mortgage.otherbroker, dbo.t_Mortgage.facetoface, dbo.t_Mortgage.origin, dbo.t_Mortgage.version, dbo.t_Mortgage.Createdagent, dbo.t_Mortgage.AssignedAgent, dbo.t_Mortgage.Createdbranch, dbo.t_Mortgage.qualagent, dbo.t_Mortgage.qualbranch, dbo.t_Mortgage.DateAssigned, dbo.t_Mortgage.AssignedBranch, dbo.t_Mortgage.whenfor, dbo.t_Mortgage.lastupdated, dbo.t_Customer.title, dbo.ws_Agent.Name AS assignedagentname, ws_Agent_1.Name AS createdagentname, ws_Agent_2.Name AS qualagentname, dbo.t_Mortgage.customerid, dbo.ws_Branch.Name AS createdbranchname, ws_Branch_2.Name AS qualbranchname, ws_Branch_1.Name AS assignedbranchname FROM dbo.t_Mortgage INNER JOIN dbo.t_QuoteStatus ON dbo.t_Mortgage.status = dbo.t_QuoteStatus.QuoteStatusId INNER JOIN dbo.ws_Agent ON dbo.t_Mortgage.AssignedAgent = dbo.ws_Agent.AgentId INNER JOIN dbo.ws_Agent AS ws_Agent_1 ON dbo.t_Mortgage.Createdagent = ws_Agent_1.AgentId INNER JOIN dbo.ws_Agent AS ws_Agent_2 ON dbo.t_Mortgage.qualagent = ws_Agent_2.AgentId INNER JOIN dbo.ws_Branch AS ws_Branch_1 ON dbo.t_Mortgage.AssignedBranch = ws_Branch_1.BranchId LEFT OUTER JOIN dbo.ws_Branch AS ws_Branch_2 ON dbo.t_Mortgage.qualbranch = ws_Branch_2.BranchId LEFT OUTER JOIN dbo.ws_Branch ON dbo.t_Mortgage.Createdbranch = dbo.ws_Branch.BranchId LEFT OUTER JOIN dbo.t_Customer ON dbo.t_Mortgage.customerid = dbo.t_Customer.ID

When initially data binding (to a form view in this case) I'm getting extra rows such as

Rowerror, haserrors, table?

I'm also getting at runtime messages saying a particular field is not present (details view) when it is clearly present at design time when looking at the bound fields, I have rebuilt everything many times.

On the design view for a gridview I'm getting the following error there was an error in rendering this control. data binding. system.data.datarowview does not contain a property with the name Id (which it does)

Is there something obvious I am doing wrong to cause this in the way I have set up my view?

Regards,

Matthew

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 28-Aug-2006 18:58:50   

Hi, I'm not sure what exactly goes wrong here, since all the problems seems related to the DataTable nature of your view, outside of LLBLGen scope.

But now, maybe you should try using a LLBLGenProDataSource(2) control as explained in the reference manual in Generated code - Databinding with ASP.NET 2.0, instead of binding your typedview directly.

You'll also find interesting information on Frans's blog at: http://weblogs.asp.net/fbouma/archive/2006/06/09/LLBLGen-Pro-v2.0-with-ASP.NET-2.0.aspx

That should abstract the DataTable structure, and you may get rid of the unexpected behaviour.

Hope that helps.

bentos
User
Posts: 146
Joined: 12-Jul-2006
# Posted on: 28-Aug-2006 20:14:26   

Thank you for the reply,

Sorry I was not clear my initial message, I am using the correct LLBLGenProDataSource(2) and it has been working very well up until now with all my data binding scenarios, it is only when I've tried using it with this typedview that the problems started to occur

Any suggestions on how we can solve this?

Cheers

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 29-Aug-2006 06:50:38   

What's the value set to the DataContainerType property of the LLBLGenProDataSource?

Please post the code that defines the LLBLGenProDataSource and the gridView.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 29-Aug-2006 13:15:21   

This thread is equal to a helpdesk question. To avoid duplicate work, let's update one of them and leave the other one. I'll leave it to bentos which medium he prefers (helpdesk or forumthread) simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Posts: 94
Joined: 23-Aug-2006
# Posted on: 30-Aug-2006 01:02:02   

I believe the helpdesk question had better details

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 30-Aug-2006 10:28:07   

Could you please check the helpdesk question and follow the steps I've explained there to see if that helps? You can continue answering the helpdesk question to avoid confusion where what's said wink

Frans Bouma | Lead developer LLBLGen Pro