How do I select user information with multiple databases using ASP & VB.NET?

eriksingapore

New Member
Okay here it goes . . . I have a web application I am developing in Microsoft Visual Web Developer using ASP, VB.net, etc. that will allow "Sellers" to post ads for "Buyers" to view. When the Buyer searches for a product, each result needs to display the Seller's name, and the product's information. The problem being that the table that holds the various product information is located in one database and the user/membership information is stored in another database. I'll provide an example. In this case the Buyer is searching for all ads for a particular book. [*]Each ad is recorded in database db_1 and table [Results] withcolumns for ID_USER, and ID_BOOK.[*]Book information is stored in db_1 [Books] with columns for ID, TITLE, AUTHOR.[*]User information is stored in a separate database db_2 and table[Users] with columns for ID and NAME.Given that, how would I do something like the following:\[code\]SELECT u.Name [Seller], b.Title [Title], b.Author [Author]FROM db_1.Results rINNER JOIN db_1.Books bON b.id = r.id_bookINNER JOIN db_2.Users uON u.id = r.id_userWHERE b.Title like 'Some Book Title'\[/code\]If these tables were in the same database (which I'm now wishing I had done), then I would easily run an inner join or some other select statement to pull only the relevant data. I've also considered creating datasets and joining them (e.g., http://www.vb-helper.com/howto_net_dataset_foreign_key.html), but wouldn't that be way too server-heavy?I'm half decent with SQL statements, but all my knowledge comes from Google and from practice so if I am ignoring some crucial caveat that every classically trained programmer is aware of, I apologize. Thank you in advance for the help.
 
Back
Top