hi i had some good question how do we join two datasets from 2 different tables in two different servers into one application can any one give that small piece of code
Loading
hi i had some good question how do we join two datasets from 2 different tables in two different servers into one application can any one give that small piece of code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijaya KadiyalaPosted Aug 1, 2008, 10:54 AM
Hi,
I agree with above post, Its always good to maintain these kind of relationships at the database level. If you want this i Datasets then check out the below link
http://www.functionx.com/vbnet/adonet/relationships.htm
Thanks -- Vj
http://dotnetjvj.blogspot.com
Niradhip ChakrabortyPosted Jul 17, 2008, 6:05 PM
You can't do that on single shot. You have two options:
1. Create a linked server in DB invironment, then create a SP to take care of it.
2. Get two DataSets for them, then merge two datatables into one based on usersID.
Hope it gives you some idea.
If it is in same server then try this:
SELECT a.userID, b.usersFirstName, b.usersLastName FROM databaseA.dbo.TableA a inner join database B.dbo.TableB b ON a.userID=b.userID