JOIN vs. DataView[Manager]... or is it?

    Date: 03/22/06 (C Sharp)    Keywords: no keywords

    Hey everyone, I'm trying to learn how to use actual ADO.NET stuff (as in, using DataAdapter's, etc. instead of just use a Command object and a DataReader) and I find myself confused by the book I got (O'Reilly's ADO.NET in a Nutshell, which otherwise has been really awesome.) To the question:

    Say I have two tables, one table, current_inventory, contains inventory items, and another, locations, contains possible locations, as well some extra information about a given location. current_inventory has a foreign key to the primary key in locations. Now, say I want to populate a DataGrid with the item descriptions and their locations. That's a pretty basic query:

    SELECT current_inventory.description
    FROM current_inventory
    INNER JOIN locations
    ON current_inventory.loc_id = locations.loc_id;

    The problem is now that if I populate the datagrid and want to change the location, it gets somewhat more complicated (or so I'm told.)

    According to this book, it is easier to select the two tables seperately into the dataset, and then somehow use the DataViewManager class to display them. I can't figure out a way to match these up and display each item with its corresponding location, except to do a master-detail type thing, but that isn't what I want to do, because it doesn't seem like a logical way to layout the program.

    So, what am I supposed to do, basically, do I just use the join, or is there something I'm missing? Thanks guys (and gals, obviously!)

    Source: http://community.livejournal.com/csharp/53647.html

« Multiselect on bound... || DataGrid Madness »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home