how to make sql inner join in two vb.net datatables?

I have one dataset that contains two DataTables:



DataTable1:

Customer_ID

1

2

3

4

5



the other DataTable2 returns

Customer_ID

4

5



If I would have treated this as regular queries and join them on Customer_ID
the resulting set would only contain:



Customer_ID

4

5



Is there a way to inner join the two DataTables to create a third DataTable
with the desired results. I have tried to user Relations.Add method with no
success.



Thanks
Ameerh24Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ReecioCommented:
I'm not sure what you're aims are, but I think you want everything from Table1 plus the information from Table2. Inner Joins pull only the common data between the two tables so I'm guessing you need an outer join.

If you want all of the rows in Table1 appended with all the rows in Table2 you'll need a left outer join, this will show all rows from Table1 but will also add the information from Table2 if there is anything there (otherwise it will be null).
Right outer join does the opposite, all from Table2 appended with data from Table1 and finally, should you need it, a full outer join gets all the information from both tables regardless if there is a common link between the two.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.