The files are divided randomly into some folders (so not to kill windows with millions( ) of files per folder).
The files are stored like this
Mainfolder
__12345
__23456
__34567
Each folder location is stored in the db with the filename. So, I've opened a connection to the DB and am using a SqlDataReader to get a list of the folder names in the main folder. Then, I am using a FileInfo[] to store the file names of the first subfolder in the SqlDataReader.
To verify both ways, I am looping through the FileInfo[] to get the filename(if i have a file name, I'm assuming the file exists, duh). Each iteration of the loop then opens an additional connection and datareader to check if the current filename exists in the db. Then closes the SqlConnection and the SqlDataReader in the loop before the next iteration.
it just seems like I'm opening and closing a lot of connections, is that a problem