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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Databinding question

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;
            firstgrid.Databind();
            secondgrid.Datasource = reader;
           secondgrid.Databind();
}
this only gives me first grid results, and not second grid.. I want both..
0
1jaws
Asked:
1jaws
  • 3
  • 2
1 Solution
 
muhammadyasirCommented:
use two different sp to populate data in gridview.
Why are you confusing yourself?
0
 
1jawsAuthor Commented:
no my sp is set up this way to gives two different type of result ...
0
 
Anurag ThakurTechnical ManagerCommented:
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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
1jawsAuthor Commented:
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..
0
 
Anurag ThakurTechnical ManagerCommented:
in that case call execute reader
do the data bind
call the other reader and then do the data bind
0
 
1jawsAuthor Commented:
thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now