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
What’s difference between “optimistic” and “pessimistic” locking?
What is the difference between rest and restful?
When cookie will expire?
Which is better session or viewstate?
What is the file extension of web service?
Explain the reason why the javascript validation not run on the asp.net button but run successfully on the html button?
What is the difference between system.stringbuilder and system.string
Can master pages be nested?
What is the question mark in a url?
Disable Mouse right click on web page in asp.net?
What is mvc in angular?
Explain Features in ASP.NET
What is a web api?
Distinguish between Server-side and Client-side code?
Explain file-based dependency and key-based dependency.