Click here to Skip to main content
15,041,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I have two queries like this

select *from sample1
select *from sample2

I would like to get the result in a single dataTable.
When I run this query I get the result in two grids. I want this to be in a single grid.


Cant this be done by joining the tables or like,

select * from sample1,sample2 

Wouldnt this be the easy way instead of 2 queries and join data tables?
Dear Friend,

If the no of columns in both the tables from the database are same then go for
functionality to get the result into one datatable.

Please follow link for more clarity:-[^]

I hope this will help you out.

You can use UNION or UNION ALL command in SQL.

For detailed information check the following link[^]

I hope this will help you. If this solution works for you then accept this answer otherwise revert back to me

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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