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
Which protocol is used to call web service?
How you will improve web application performance?
What is the most appropriate lifetime for a database connection/orm context in an asp.net mvc application? : Asp.Net MVC
Give an example of cookie abuse.
What is the use of session in web application?
What is asp.net localization?
Can I read the hard disk serial # of the client computer using asp.net?
Tell me the code snippet to show how we can return 404 errors from HttpError?
How to do parallel database export in remote SQL Server in ESSL time track. It is working for local server but not working for remote SQL Server
What is runat?
What are httphandlers and httpmodules and difference between them?
Is post back in asp.net?
what are configuration files?
What is the difference between client-side and server-side validations in ASP.NET?
What is AutoPostback?