Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I use a table in a DataSet in a query?

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
Hi, hope I'm asking in the right place...

I am writing a VB.NET 2005 app using an Access DB. I have a table in my dataset I have already filled with records (randomly) I want to include in my results. I also need to select records for a new query and compare them to the results in that table, leaving out any records that don't match the selections in the first.

I could do it programmatically, iterating through all the records in the second data table and discarding any that don't match what's in the first, but I'd rather do it in the query first if I can.

If I were doing this in Oracle I would think I'd use a stored proc with a cursor in it, but I'm using Access and I'm not very familiar with this yet. Any suggestions on how to approach this?

Thanks

CraigHartz
 
leaving out any records that don't match
You may consider an INNER JOIN.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Right - but one of the 'tables' is a datatable in a dataset in the program, and not on the database at all. An inner join would work fine if both tables were in the DB, but that's not what's happening here.

If it helps, the two tables (well, one table and one datatable) are structured identically.

CraigHartz
 
Since your question really concerns how to use a DataSet this is really an ADO.NET question, not Access.
 
Well, since I couldn't locate a forum here dealing with ADO.NET...

Maybe I missed it, but thanks for your post anyway.

CraigHartz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top