Print Page | Close Window

Object mapper not showing Views in "Add Classes" dialog

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3634
Printed Date: 21-Jan-2026 at 7:09pm


Topic: Object mapper not showing Views in "Add Classes" dialog
Posted By: Miszou
Subject: Object mapper not showing Views in "Add Classes" dialog
Date Posted: 18-Sep-2012 at 12:08pm
I have a solution that is using four different data sources, all of which are different SQL Server databases (multiple databases on the same physical and logical server)
 
Everything is working great, except that only one of these data sources allows me to add a new class based on a database view. The other three databases are showing an empty list. The tables and stored procedures are shown in the list for all 4 data sources - it is only the database Views that do not appear.
 
I am assuming that there is something amiss with my databases, but I cannot for the life of me figure out what is different between the one that works and the ones that do not. I imagine it is something to do with permissions or meta-data visibility, but I simply cannot get the database Views to display in the Add Classes dialog.
 
Has anyone ever seen this before?
 
Oh, and I'm using DevForce Classic 3.7.6.0.
 
Thanks,
 
Dan.



Replies:
Posted By: kimj
Date Posted: 20-Sep-2012 at 1:02pm
Hi Dan,
 
You should be using an OLE-DB provider with the Object Mapper, so one thing to check is the connection string for these data sources.
 
Next, if these are system views, toggle the "Show System Objects" item under the Options menu.
 
In the Add dialog, make sure the schema/owner is either blank or set correctly, and "refresh" to ensure the list is current.
 
Other than the above, I'm not sure what else to check. DevForce is using the OLE-DB GetOleDbSchemaTable call to retrieve all schema information (when the OLE-DB provider is specified in the connection string).


Posted By: Miszou
Date Posted: 21-Sep-2012 at 12:45pm
Ok, I found a workaround...
 
Since one database was allowing me to see views in the mapper, I simply created the view in that database as a trivial "select * from otherdatabase.view", added this new view to the mapper and saved the updated model.
 
Then I opened the .ORM file, changed the datasource to point to the correct database, saved it, re-opened the mapper and forced it to regenerate the model.
 
Finally, I deleted the temporary view in the database and everything appears to be working, so far.
 
The views are still not showing up in the Object Mapper, but at least the code generator doesn't seem to care, so I am able to create a class from the database view.
 
 



Print Page | Close Window