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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataTable Selecting + NOT IN

Status
Not open for further replies.

tEkHEd

IS-IT--Management
Jan 29, 2003
261
GB
Hi there..

I have a dataset created of 3 tables, my structure is a little like:

Application Table:
AppID (Int32 Auto generated (primary key))
AppName (String)
AppLicense (string)

Busines Layer Table:
BLID (Int32 Auto generated (primary key))
BLName (String)

BL_mm_App:
ID (Int32 Auto generated (primary key))
BLID (Int32)
ApplID (Int32)

I have 2 relationships defined.

relAppToBL (BLTable.BLID on BL_mm_App.BLID)
relBLToApp (AppTable.AppID on BL_mm_App.AppID)


This allows me to identify all the applications that are included in any given business layer by performing the following:

Code:
Dim BLApps() as DataRow = dtBL_mm_App.Select("BLID = '2343')

I now need to perform the opposite query (i.e. list all applications not in a business layer). however I cannot figure out how to do a not in...

something like.
Code:
Select * from Apps where AppID Not In (Select Distinct AppID from BL_mm_App)

Can anyone point me in the right direction please.

Thanks in advance.
 
call it from the db in a separate query.
all i could think of!
Steve
 
I can't do that as this is an in-memory dataset build from directory.services queries from Active Directory.
 
I think that's a fair point to be honest. Why carry around all the extra data when it's not needed? I would have thought that two hits to the db/ad would be more efficent than using up that extra memory (just a guess, so that may not be true).

Could you specify which accounts need to be returned from the Active Directory? If so, then just create the relevant tables (business and non-business) when you need them.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top