Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ProcessRecord(string optionCode, string iso, string partNumber, string skuCode, string serial, string upc, string date, string description, string country, string machine)
- {
- OleDbConnection con = new OleDbConnection(ConnectionString);
- try
- {
- con.Open();
- OleDbCommand cmd = new OleDbCommand("", con);
- string sqlCopy = @"INSERT INTO Archive ( PartNumber, SerialNumber, UPC, [Option], Product, Description, Country, PrintDate, Machine )
- SELECT PartNumber, SerialNumber, UPC, [Option], Product, Description, Country, PrintDate , Machine FROM [Output];";
- string sqlDelete = @"delete from [Output];";
- string sqlOutPut = @"INSERT INTO [Output] ( PartNumber, SerialNumber, UPC, [Option], Product, Description, Country, PrintDate, Machine )
- values ( '" + partNumber + "', '" + serial + "', '" + upc + "', '" + optionCode + "', '" + skuCode + "', '" + description + "', '" + country + "', '" + date + "', '" + machine+ "');";
- cmd.CommandText = sqlCopy;
- int countCopy = cmd.ExecuteNonQuery();
- cmd.CommandText = sqlDelete;
- int countDelete = cmd.ExecuteNonQuery();
- cmd.CommandText = sqlOutPut;
- int countInsert = cmd.ExecuteNonQuery();
- while (backgroundWorker1.IsBusy)
- {
- System.Threading.Thread.Sleep(100);
- }
- backgroundWorker1.RunWorkerAsync();
- }
- catch
- {
- }
- finally
- {
- con.Close();
- }
- }
Add Comment
Please, Sign In to add comment