SqlCommand sqlCommand = new SqlCommand(); sqlCommand.CommandType = CommandType.Text; sqlCommand.CommandText = "select closedrwrs from dbo.prefs_sl;"; if (database.ExecuteSqlCommand(sqlCommand, ref messageText, ref statusCode)) { Int16 closeDrawers; if (Int16.TryParse(messageText, out closeDrawers)) { if (closeDrawers < 2) { statusCode = 610; messageText = "System is not set up to close cash drawers"; } // Ok to close a drawer else { sqlCommand.Parameters.Clear(); String currentOperator, currentSalespoint, closeOperator, closeSalespoint, cDetails; currentOperator = GetParameterValue(parameters, "tcOperator"); currentSalespoint = GetParameterValue(parameters, "tcSalespoint"); cDetails = GetParameterValue(parameters, "tcDetails"); closeOperator = cDetails.ParseStringFromSqml("CLOSE_OP"); if (String.IsNullOrWhiteSpace(closeOperator)) closeOperator = currentOperator; closeSalespoint = cDetails.ParseStringFromSqml("CLOSE_SP"); if (String.IsNullOrWhiteSpace(closeSalespoint)) closeSalespoint = currentSalespoint; DateTime startTime, endTime; startTime = cDetails.ParseDateTimeFromSqml("START_TIME"); endTime = cDetails.ParseDateTimeFromSqml("END_TIME"); String closeType;There are many lines of code below, but that first part is what is common between two different methods in VFP (where it's repeated as is in both methods).