简体   繁体   中英

merging two data tables in a third table in c#

I have two data tables containing one common column.I want to create a join between the two tables and get the data in a third table.

eg data table 1: column employeeid,name,number

data table 2: column employeeid

i want to remove all the employee id's that are in the second table from the first table and display the rest of the values.

Can someone please help me with this.

Thanks

The CreateJoinTable method in this article provided one solution to your question: http://support.microsoft.com/kb/326080/en-us

Also, dataTable.Merge() is an option to look at.

Last, I suspect you will get a wealth of information from StackOverflow if you haven't already posted this question there as well.

My apologies if your question was not targed at C# as the answer will depend on the target platform you are querying ... SQL Server, MySQL, C# code, etc.

Have a great day.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM