troubleshooting Question

OleDbConnection: combining queries

Avatar of roflkind
roflkind asked on
4 Comments1 Solution283 ViewsLast Modified:

Question 1:
i am using an OleDbConnection to receive data from an Access DB.
I get all the news written with this command:
"SELECT * FROM news" and i fill them with OleDbDataAdapter into a dataset.

But there is another table called newscom, which is standing for the comments written for a news.
I get all the comments written for one news using this command:
SELECT * FROM newscom WHERE id LIKE 'newsid'

And now i want the number of comments written for one news to be a column in my news table fetched with the OleDbDataAdapter. (Combining the first query with the second one)

Question 2:
The second question is very similar to the first one.
This time i have the author from a news, and i want to get all informations stored in the user db for this author.
The command to get the userrow with the information in it is:
SELECT * FROM user WHERE id LIKE 'authorid'

Now i want to combine the news query and the user query.
Again I want the UserRow to be a column (as an object or sth like that) in my news table fetched with the OleDbDataAdapter.

Any suggestions?

Best regards,

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros