U
UJ
I have a dataset that will have say 10000 records in it with the names of
files that are used by the system. I then have a large directory of files
that correspond to that list of files and want to find any files that are in
the directory but not referenced anymore (trying to do cleanup.) I know how
to do all of the stuff but am looking for opinions/suggestions on the
searching of the table. If you have say 10000 records, what's the fastest
way to find a record with a certain value. Here's a code snippet of what I'm
talking about.
GetListOfFilesInUseByDB
GetListOfFilesOnServer
for each File in GetListOfFilesOnServer
if File not in ListOfFilesInUseByDB
deleteFileFromServer
end if
next
I guess what I'm trying to find out the most efficient way to do that 'not
in ListOfFilesInUseByDB'. I know I could filter the datatable. I could also
do a Select on the datatable but since this could have a large number of
records, I wonder if there's a way to put an index on the datatable so it
will search faster....
Any thoughts would be appreciated.
J.
files that are used by the system. I then have a large directory of files
that correspond to that list of files and want to find any files that are in
the directory but not referenced anymore (trying to do cleanup.) I know how
to do all of the stuff but am looking for opinions/suggestions on the
searching of the table. If you have say 10000 records, what's the fastest
way to find a record with a certain value. Here's a code snippet of what I'm
talking about.
GetListOfFilesInUseByDB
GetListOfFilesOnServer
for each File in GetListOfFilesOnServer
if File not in ListOfFilesInUseByDB
deleteFileFromServer
end if
next
I guess what I'm trying to find out the most efficient way to do that 'not
in ListOfFilesInUseByDB'. I know I could filter the datatable. I could also
do a Select on the datatable but since this could have a large number of
records, I wonder if there's a way to put an index on the datatable so it
will search faster....
Any thoughts would be appreciated.
J.