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.

This entry was posted in Data Binding. Bookmark the permalink.

4 Responses to Binding to joined tables

  1. alex says:

    save to my Bookmarks )

  2. Peony says:

    People should read this.

  3. 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

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">