Binding to joined tables

Many times it is necessary to bind to a datatable which is made up of multiple database tables.  Most databases are normalized.  In Visual Studio 2005 there was a particular technique to do this.  Write your join statements in stored procedures, and create a table adapter within the dataset designer to use these stored procedures for update/delete and so forth. 

With the advent of LINQ to SQL, there is a new way.  First, create your objects, and then bind directly to a LINQ query. Note however that when binding to a LINQ query, the information is read-only. If you want a read-write binding to multiple database tables, a table adapter wired up to stored procedures for SELECT, INSERT, UPDATE, and DELETE commands is still the best way to accomplish this.

4 Responses to “Binding to joined tables”

  1. alex Says:

    save to my Bookmarks )

  2. Peony Says:

    People should read this.

  3. KattyBlackyard Says:

    Hi, very nice post. I have been wonder'n bout this issue,so thanks for posting

  4. derekpm Says:

    Rather interesting. Has few times re-read for this purpose to remember. Thanks for interesting article. Waiting for trackback

Leave a Reply