Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

C# code to drilldown DataSet with multiple tables with relationships

Posted on 2009-02-14
2
Medium Priority
?
1,056 Views
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.,
0
Comment
Question by:LarsNess
2 Comments
 
LVL 16

Expert Comment

by:sunithnair
ID: 23640514
Try this
if(dataset.Tables.Count>0 && dataset.Tables[0].Rows.Count>0)
{
  foreach(DataRow dr in dataset.Tables[0].Rows)
  {
     Response.Write(dr["ColumnName"].ToString()+"<br>");
     Response.Write(dr["ColumnName"].ToString()+"<br>");
     Response.Write(dr["ColumnName"].ToString()+"<br>");
     Response.Write(dr["ColumnName"].ToString()+"<br>");
  }
}

Open in new window

0
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 1500 total points
ID: 23640632
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
http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=54746

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
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

579 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