Search EggHeadCafe's Job Board
EggHeadCafe Silverlight WPF ASP.NET VB.NET C# Excel SQL Server SharePoint
search
MicrosoftArticlesForumsFAQs
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml / Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

WebArticlesForumsFAQs
JavaScript
ASP
ASP.NET
WCF

DatabasesArticlesForumsFAQs
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsFAQs
Excel
Word
Powerpoint
Outlook
Publisher
Money

Non-MicrosoftArticlesForumsFAQs
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

Operating SysArticlesForumsFAQs
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsFAQs
BizTalk
Site Server
Exhange Server
IIS

Graphic DesignArticlesForumsFAQs
Macromedia Flash
Adobe PhotoShop
Expression Blend
Expression Design
Expression Web

OtherArticlesForumsFAQs
Lounge
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Product Reviews
Search Engines
Resumes

 

  View Other ADO/ADO.NET Posts   Ask New Question  Ask New Question With Power Editor

ADO NET 2 0 Object Mapper - Multi-table queries
Mike MacDonald posted at Tuesday, July 04, 2006 8:07 PM

After reading the Readme file and the .NET 2.0 generics article, I'm still a tad confused when it comes to using the generated classes for stored procedures that have multiple table queries.  I'm hoping that someone will be able to clarify.

Let's say, for example, a database has two tables - TableA and TableB and a stored procedure - ProcX, which uses both tables in a select query.

The ADO.NET Object Mapper will generate the data classes (TableA.cs, TableB.cs) and associated interfaces (ITableA.cs, ITableB.cs) for the tables.  These can be placed into an assembly named DataTransfer.  The mapper will also generate a class for the stored procedure (ProcX.cs) and a wrapper for the stored procedure (also named ProcX.cs), both of which can be placed into an assembly named Database.  The Database assembly references the DataTransfer assembly as well as another assembly named BusinessRules (which also references the DataTransfer assembly).

In the BusinessRules assembly, I create a new class named Result.  If ProcX only queried from TableA, then this Result class would inherit DataTransfer.Tables.TableA and the user interface layer could then use the Result class when retrieving a generic list or DataTable.  However, ProcX queries from both TableA and TableB and the Result class can’t inherit both.  
 
So, what must I do in the Result class to make it work with ProcX and properly use the TableA and TableB classes (let’s say the query is selecting ColA1, ColA2, ColA3 from TableA and ColB6, ColB7 from TableB where TableB.ColB2 = TableA.ColA1)?
Reply    Reply Using Power Editor
  Rank Winnings Points
November 0 $0.00 0
October 0 $0.00 0