When you open your file for reading, you can lock the file (assuming you are using FileStream to open the file). The FileStream object has a Lock method which locks the file so that no other process can access it.
Dim FileSt As FileStream = New FileStream("test.dat", FileMode.Open, FileShare.None)
Try
FileSt.Lock(0, 100)
Console.WriteLine("Locked")
Catch Ex As Exception
Console.WriteLine(Ex.Message)
End Try
So even if you have multiple instances of your application, check for files if they are locked before you process them.
Regards,
http://www.sql-server-helper.com/sql-server-2008/sqlconnection-connection-string.aspx