title: Insert thousands of records one by one
body: <p>Edited...</p>
  
  <p>Probably I wasn't clear in my original post. I only process the File name.</p>
  
  <p>The file name already contains all the information I want.
  Eg. <code>2011--8-27_13:20:45_MyLocation_User1.jpg</code>.</p>
  
  <p>I decode the name and insert into the table with columns (DateTime, Location, User).
  I'm not opening the file. It's a Jpg image. After processing it, I need move the file to a folder based on the UserName.</p>
  
  <p>Now I'm using Insert Statement</p>
  
  <pre><code> Private Function InsertToDB(ByVal SourceFile As String, ByVal Date_Time As DateTime, ByVal Loc As String, ByVal User As String) As Boolean
  
      Dim conn As SqlConnection = New SqlConnection(My.Settings.ConString)
      Dim sSQL As String = "INSERT INTO StageTbl ...."
      Dim cmd As SqlComman
      cmd = New SqlCommand(sSQL, conn)
  
      ....Parameters Set ...
  
        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()
        conn = Nothing
        cmd = Nothing
      End Function
  </code></pre>
  
  <p>The function will be called for every single file found.</p>
  
  <p>Is this most efficient way? Looks like it's is very slow. I need to process about 20~50 files/sec. Probably a stored procedure?</p>
  
  <p>I need to do this as fast as possible. I guess bulk insert not applicable here.</p>
  
  <p>Please help.</p>