Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
'SELECT the master data to be archived into a temp datatable dtTmp.Clear() 'clears the temp datatable of data strSQL = " SELECT ID AS Source_ID, MFGNUM_0, Part_Number, Test_Results, Format(Test_Date, 'yyyy-MM-dd hh:mm:ss') AS Test_Date, Test_Cell, '" & stMASTNAME & "' AS Comp_ID" & _ " FROM tbllkt_trans_log" & _ " WHERE Test_Date < Date_Sub(CURDATE(), INTERVAL " & bInt & " DAY);" cnM.Open() cmd = New MySqlCommand(strSQL, cnM) rst1 = cmd.ExecuteReader() dtTmp.Load(rst1) 'loads the temp datatable rst1 = Nothing cmd = Nothing cnM.Close() 'Loop the rows of the datatable and set the row status to ADDED 'NOTE This is required for the subsequent INSERT to work. For Each dr As DataRow In dtTmp.Rows dr.SetAdded() Next 'INSERT the master temp datatable to the archive database strSQL = " SELECT Source_ID, MFGNUM_0, Part_Number, Test_Results, Format(Test_Date, 'yyyy-MM-dd hh:mm:ss') AS Test_Date, Test_Cell, Comp_ID" & _ " FROM tbllkt_trans_archive" cnA.Open() Dim daAdapter As New MySqlDataAdapter(strSQL, cnA) Dim dcbCommand As New MySqlCommandBuilder(daAdapter) daAdapter.Update(dtTmp) daAdapter.Dispose() dcbCommand = Nothing cnA.Close()
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.