Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have to quesries like.

SQL
select name from tableone

and second is
SQL
select sum(quantity) from tabletwo.

if there is only one query then i can show it in gridview using SqlCommand or SqlDataAdapter but i have to using two tables .Here joining is not possible that's why

I have to display data in gridview .

Please help me.

thanking you
Mohd Wasif
Posted
Updated 26-Apr-11 23:26pm
v2

I cannot understand why you can join them and send the resultset. Ultimately you are going to display it in grid.

One you you could, get the result from two queries, and merge them into single datatable in your application and show it in grid.

Let me know, if you are looking for something else.
 
Share this answer
 
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.

ADO.net:

http://msdn.microsoft.com/en-us/magazine/cc188919.aspx[^]

Entity Framework:

http://msdn.microsoft.com/en-us/library/bb896266.aspx[^]
 
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