Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to show 2 query result in 1 grid view how can i do this
Posted
Comments
__TR__ 4-Dec-12 4:51am    
If both the queries have same column names you can use Union or Union all[^] to combine the results of both the queries.

Get the results from both queries and join them in memory just before you bind them to the GridView instead of joining them in a single query.

Similar solved thread : show data of both queries at runtime in a grid view[^]
 
Share this answer
 
v2
Comments
f.sarikhani 4-Dec-12 4:48am    
how can i do this?
i have data in gridview and whith click on button i want to execute another query and then its result add to gridview and this action can happen multi time
[no name] 4-Dec-12 4:52am    
I've updated solution.. explore link :)
Hi dear,

Get the result when the both query are joining [Inner Join, Outer Join etc ] Or Union Or Union All.
 
Share this answer
 
Comments
f.sarikhani 4-Dec-12 5:01am    
the query is varable and in run time with input value is dimonestrate
also the number of clicking on button is varable then the number of query is varable how can do this?????
Create a view by joining both tables and then bind this view to the gridview control.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900