How to merge 2 tables fields in DataTable in asp.net

Answer Posted / abc

DataTable dt1 = retDT("select col1,col2 from Table1");
DataTable dt2 = retDT("select col3,col4 from Table2");
dt1.Merge(dt2);

retDT is a funtion to return datatable based on the query.

The output will be like below
if you check the dt1 content then the output will be

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of master page?

510


Which data type does the rangevalidator control support?

541


How may clustered index we can create in table?

557


Can we have multiple master pages in asp net?

500


What are server activated objects?

623






What does clearing cache?

524


What is round trip in asp.net?

502


What are the components of ado.net?

524


What language is asp.net written in?

518


What is manifest in .net framework?

528


Tell me the code snippet to show how we can return 404 errors from HttpError?

775


Define page fragment caching?

510


in which protocol ASP.NET WEB API Work?

604


How asynchronous call can be implemented using delegates?

528


Describe Segmentation With Paging?

619