private bool WriteOutDataAsSdf(ref string sdfOutputFile, ref DataTable dataTable) { SqlCommand commandRowCount = new SqlCommand("SELECT COUNT(*) FROM " + "sdf.PLU Codes;", connection); long countStart = Convert.ToInt32(commandRowCount.ExecuteScalar()); MessageBox.Show("Starting row count = " + countStart); using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection)) { bulkCopy.DestinationTableName = "sdf.PLU Codes"; try { // Write from the source to the destination. bulkCopy.WriteToServer(dt); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)