Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

ADO.Net DBGRID

JayeshrJayeshr Posts: 2Member
I have a windows form with 3 tables on a grid :-

Orders, OrderDetails, Products

These are all from Northwind database using sql sever

I can drill down from the orders table and it highlights the relevant order detail record as i select an order from the order grid

However, for the life of me I cannot get the products grid to show the relevant product details against the orderdetails grid.

If I select an order -> the relevant orderdetails are shown in the orderdetails grid

however i want to see in the grid products the relevant product names

Can anyone help?

Using the Biding soruce as the products table and the foreign key from the orderdetails table FK_Order_Details_Order just messes up my grid with labels from the orderdetails grid and not the products grid


Comments

  • DaiMitnickDaiMitnick Posts: 77Member
    Could you give any code?

    How are you doing it at the moment, are you making the datagrids connect directly to tables in Sql Svr, or are you sending the outputs of the query into a dataset then binding that to the datagrid?

    Can you not just use a join query, with some group by clauses to achieve what you need?

    Sorry for all the questions, just hard to help without knowing more or seeing what you're trying to achieve exactly. Regards, Dai


    ------------------------------------------
    Do or do not, there is no try. |
    ------------------------------------------
  • JayeshrJayeshr Posts: 2Member
    Hi,

    I'm basically in visual studio 2010 connecting to the northwind database, selecting the tables that i will use, namely, orders, orderdetails and products.

    then dragging these onto a windows form.

    i have managed to get the second dbgrid orderdetails to drill down based on whatever row i pick in the first grid (orders).

    however i cannot seem to do the same with the products table, as i want to see what product names are on the second grid.

    So its uses a dataset for all three tables.

    Sorry i'm new to vb.net.
    I just bought 3 books, Microsoft Visual Basic 2010 Step by Step, visual c# 2010 SArep by Step and ASP.Net 2010 Step by Step.

    The problem with these is they show a simple approach, however if you wan to do something a bit meaningful the example required is not in the book.

    As I am visual studio 2010 can you suggest any really good books on vb and asp for above application.

    Also any good learning sites.

    Thanks again. Hope I've answered as required.
Sign In or Register to comment.