Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sunil kumar

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

col1 col2 col3 col4
1 2 3 4

Is This Answer Correct ?    21 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of session management?

932


Which library is used by the testers and developers to develop automated tests and create testing tools?

932


What is asp.net futures?

1034


How do you declare static variable? What is its lifetime?

911


What is Partial PostBack in ASP.NET?

979


What is asp.net localization?

934


How can you implement the postback property of an asp.net control?

938


Are xaml file compiled or built on runtime?

911


Explain what is clr?

976


Can you set which type of comparison you want to perform by the comparevalidator control?

864


What does the hotspot class in .net do?

947


What is the use of placeholder control? Can we see it at runtime?

1016


What is rending process in ASP.NET?

1023


Differentiate strong typing and weak typing

888


What are the new web part controls in asp.net 2.0 ?

965