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
Where web.config file is used?
What is form submit?
What is dynamic web page with example?
Difference between .NET and previous version?
How to turn off cookies for a page?
Please briefly explain the usage of global.asax?
How to disable disable browser's Back button in asp.net (JavaScript)?
Who creates jsessionid?
What is server side session management?
What language does asp.net use?
Web API supports which protocol?
How many types of session in ASP.NET
How can we inherit a static variable?
How to make paging concepts in datagrid in ASP.NET?
Explain difference between dataset and datareader?