David Smith

David Smith

  • NA
  • 2k
  • 0

Executing bat file using bcp to copy datatable to text file

Mar 9 2012 11:10 PM
Can you give me the logic to use the SqlBulkCopy to copy data table from SQL SERVER Datatable to text file.

this works below, but once I execute the bat file I have no way of knowing when its down, what I am doing is copying all data to text files, then afterwards, delete from the database. So is there a way to know if the bat file has finished executing berfore deleting from the database.

      process.StartInfo.UseShellExecute = false;
              
      process.StartInfo.FileName = Directory.GetCurrentDirectory.;

      if (File.Exists(RapidViewClient.Properties.Settings.Default.ExamplePath))
      {
           process.StartInfo.CreateNoWindow = false;
           process.Start();
      }

Answers (1)