populating gridview

Posts   
 
    
Nav
User
Posts: 9
Joined: 12-Jan-2009
# Posted on: 12-Jan-2009 20:52:17   

Is there a way for each column in a grid to determine which table or entity they belongs to using llblgen DAL? I have an updatable view made up from many tables and would like to know the base table of each column. I want to know it programatically as I want to come up with generic code to populate grid and then determine the base tables for each column.

I know that I can use View Information schema but I want to find out through llblgen DAL?

Any help will be appreciated.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Jan-2009 03:47:43   

Is this view a TypedView, TypedList, or a View mapped on entity? LLBLGen version and TemplateSet (Adapter/SelfServicing) ? (http://llblgen.com/TinyForum/Messages.aspx?ThreadID=7725)?

David Elizondo | LLBLGen Support Team
Nav
User
Posts: 9
Joined: 12-Jan-2009
# Posted on: 13-Jan-2009 16:28:00   

It is a View mapped on entity, since the requirement is to have the capability to edit columns in grid. Since it a database view, i can check the schema to determine the tables used for each column but I want same sort of deal from llblgen DAL not from Database.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 13-Jan-2009 22:17:42   

Please see this thread

and this one which even has the code to do it simple_smile

Matt

Nav
User
Posts: 9
Joined: 12-Jan-2009
# Posted on: 14-Jan-2009 00:08:35   

Since the grid is based on a view(consisting of multiple tables), if I use entity.fields(0).GetObjectSourceName (selfServicing) it gives me name of the view. But, the requirement is to find the underlying table for that column.

Is there a way where we can determine for a given view these columns comes from these tables?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 14-Jan-2009 03:03:14   

Hi there... I think that is not possible. Remember that the parent of a view's field is not necessarily a table. It could be another view, a subquery, the result of a calculated field, the result of an expression, etc. So I doubt this information is available on the Database drivers to O/R world.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 14-Jan-2009 16:06:47   

Indeed, that meta-information is not available and also not retrievable from the database meta-data unless the SQL of the view is parsed which is very hard to do (read: VERY hard to do) and can be impossible if the view's sql is encrypted.

Frans Bouma | Lead developer LLBLGen Pro
Nav
User
Posts: 9
Joined: 12-Jan-2009
# Posted on: 14-Jan-2009 16:08:45   

Thanks for your help