You can do what Cerebrus suggested or if you have control over the
DBMS, then you could create a view or Store Procedure to handle and
validate the Join Criteria.

LINQ allows you to do the SQL Join through Code Extension of a class
and keep it native to your Language of choice.  It requires a bit of a
learning curve since it basically breaks the OOP design and structure
that most are used to.

With SQL Side Joining, you put a layer of mitigation from the end-user
source crawling to find out your Join information.  As well, you
remove alot of the Code design necessary to develop this Join.  By
removing it from the code, if you change the Join criteria or return
fields you do not have to republish/recompile the source code for the
changes to take effect.

Pending on the level of security and what access to the back-end
Database, you can use one or the other methods.

On Aug 31, 9:59 pm, jwz <[email protected]> wrote:
> I'm new to VB.NET, after using VB6 for a decade or so. A friend and
> some books are what I'm using to learn. My friend taught me about the
> Data Access Layer, and I've created some simple classes for simple
> tables. For example, I have a supplier class for the supplier table,
> and a part class for the part table, and an order class for the order
> table. Each class provides the ability to read, update, insert,
> delete, etc., its table.
>
> My question comes in when I need to join tables. For example, if I
> want to join the part table and the order table, each class only knows
> about its table. The select statement in the part class doesn't have
> access to the column definitions in the order class, and vice versa.
>
> When I asked my friend about this, he said I should create a Join
> class. In this class, one of the classes, say the part class, is
> inherited, but I need to define the fields from the order class that I
> want to retrieve.
>
> My problem with this is that if I have several of these join classes,
> then I've duplicated several table definitions, and if I change a
> table in the database, I have to change not only the class that
> represents that table, but I also have to track down all of the Join
> classes this table is defined in, and change them.
>
> It seems like there should be a better way, but I haven't been able to
> find it.
>
> Should I include all of the tables from the database into a single
> class, so that I can reference any table that I need to join?
>
> Is there some other, better way?
>
> Thanks for the help.
>
> Joel

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to