Databinding question

Posted on 2009-12-21
Last Modified: 2012-05-08
when you execute sp, if it returns two different type of dataset (result) and if I want to show this in two different grid. How would I do cs code?
reader = comm.ExecuteReader();

            if (reader.HasRows == true)
            firstgrid.Datasource = reader;
            secondgrid.Datasource = reader;
this only gives me first grid results, and not second grid.. I want both..
Question by:1jaws
    LVL 5

    Expert Comment

    use two different sp to populate data in gridview.
    Why are you confusing yourself?

    Author Comment

    no my sp is set up this way to gives two different type of result ...
    LVL 26

    Expert Comment

    by:Anurag Thakur
    the question is not quite clear
    at one side you mentioned dataset and on the other side your code example talks about reader
    how are these two connected

    instead of using the reader if you use the data set it will make more sense as readers are generally connected and datasets are disconnected

    Author Comment

    I am sorry, I want to use readers.. when I execute my sp it gives two record sets and want to use readers to process to results..
    LVL 26

    Accepted Solution

    in that case call execute reader
    do the data bind
    call the other reader and then do the data bind

    Author Closing Comment


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 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

    25 Experts available now in Live!

    Get 1:1 Help Now