C# code to drilldown DataSet with multiple tables with relationships

Posted on 2009-02-14
Last Modified: 2012-05-06
Hello. I need a quick solution for drilling down a DataSet that I have filled from an XML file using the ReadXML method. I am in a bit of hurry - so I was hoping someone had a code snippet that does this using the DataGridView (or something else that does the trick) where I can adapt it to my specs.

The DataSet content is ready. I just need to be able to drill it down. It can be with another language. I can change it to C# myself :-) Thanx.,
Question by:LarsNess
    LVL 16

    Expert Comment

    Try this
    if(dataset.Tables.Count>0 && dataset.Tables[0].Rows.Count>0)
      foreach(DataRow dr in dataset.Tables[0].Rows)

    Open in new window

    LVL 26

    Accepted Solution

    in my viewpoint the best approach for implementing a drill down in a data set is by using datarelations between the master and child detail tables

    when a particular record is selected then all the rows in different tables can be easily fetched from relations which is the best way to go

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now