title: Problems importing database from vb.net
body: <p>I’m trying to import a table into a secured sql database using vb.net but it seems to timeout (or so I think) and not import properly (null value), I truncate the table to save the field types and then call the shell() function to import the file and</p>
  
  <p>'Clean out the existing data in the validation import table</p>
  
  <pre><code>cmd.CommandText = "TRUNCATE TABLE HedgeFileBuilders.dbo.HedgeInput_" &amp; strProduct &amp; "_VALIDATOR;"
  cmd.ExecuteNonQuery()
  
  're-import the inforce file to validate it
  
  Try
      If chkSQLServerSource Then
      Shell(SQLLOCALDIR &amp; "Prog\bcp.exe FileBuilders.dbo.Input_" &amp; strProduct   &amp; "_VALIDATOR in " &amp; strFileName &amp; "  -c -t , -r \n -S server -U user -P passkey -F 2 -h TABLOCK", AppWinStyle.Hide, True)
      Else
      Shell(SQLLOCALDIR &amp; "Prog\bcp.exe FileBuilders.dbo.Input_" &amp; strProduct &amp; "_VALIDATOR in " &amp; strFileName &amp; "  -c -t , -r \n -S pcname -T -F 2 -h TABLOCK", AppWinStyle.Hide, True)
      End If
  Catch ex As Exception
      MessageBox.Show("ERROR: An error occurred while re-importing the new business file.  Contact the system administrator.  " &amp; ex.Message, "Contact System Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error)
      Exit Sub
  End Try
  </code></pre>
  
  <p>'THIS DOESN'T Return and Error but null results.  I do the import manually in SQL and it   works (all the data is there). I even use the strFilename and Table name indicated above from vb code to make sure I didn't get the names wrong when importing manually. </p>
  
  <p>What am I doing wrong?</p>
  
  <p>P.S. I tried the timeout integer parameter '-l', after the boolean 'True' above and it did not help.</p>