I'm developing a software that during its start-up will check if the attached local database (by which I mean a separate .mdf file that is attached using an open dialog box) is the appropriate database for the software. And if it is, I'll copy the source file, then paste it where my software can always find it (ex. C:\Program Files(my system generated folder)). To do that, I have to first release the .mdf file so I can copy it to my folder.
How can I release the .mdf file so I can create a copy of it to my desired folder during runtime of my software? I'm using vb.net.