Private Sub FullBackUp() Try sqlCmd = New SqlCommand() sqlCmd.Connection = sqlCon sqlCmd.CommandType = CommandType.StoredProcedure sqlCmd.CommandText = "prcBackUpFullData" 'Add Tenant Details sqlCmd.Parameters.AddWithValue("@DatabaseName", "CLINIC") sqlCmd.Parameters.AddWithValue("@path", filePath) 'open sqlcon sqlCon.Open() 'Perfoming the full back up Me.LabMsg.Text = "Wait while System is performing the full CLINIC back up......" _result = sqlCmd.ExecuteNonQuery() If _result = -1 Then Me.LabMsg.Text = "The STOCK Full back up performed successfully." MessageBox.Show("The STOCK database has been back up successfully. ", "Back Up ", MessageBoxButtons.OK, MessageBoxIcon.Information) btnBrowse.Enabled = True Me.LabMsg.Text = "Done." End If Catch ex As Exception Me.LabMsg.Text = "Unable to perform the STOCK back up." MessageBox.Show(ex.Message.ToString, "Back up", MessageBoxButtons.OK, MessageBoxIcon.Error) MessageBox.Show("Unable to perform the STOCK back up. Close the form and try it again." + vbCrLf + "If the problem persists, please contact the vendor.", "Back up ", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally sqlCon.Close() sqlCmd = Nothing End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)