Quote:
How to fix error, "the name 'con76' does not exist in the current context"?
You need to study what is the scope of a variable.
if () {
}
else {
}
if () {
}
else {
}
-----
SqlCommand scmd6 = new SqlCommand("UPDATE EMPLOYEE_BASE_DATA SET CURRENT_BASE_PCT = '" + BASE_PERCENT + "', CURRENT_TOTAL_PCT = '" + TOTAL_PERCENT + "', REQUESTED_PCT = '" + DEFAULT_PERCENTILE + "', SALARY_ADJUSTMENT = '" + SALARY_ADJ + "', NEW_TOTAL_PCT = '" + NEW_TOT_PCT + "', SALARY_FOR_REQ_PCT = '" + NEW_BASE_SAL + "', X_CURRENT = '" + BASE_SALARY + "', PROPOSED_X = '" + NEW_BASE_SAL + "', Y_SUPPLEMENT = '" + SUPPLIMENT + "', Z_INCENTIVE = '" + SALARY_ADJ + "', TOTAL_COMPENSATION = '" + TOTAL_SALARY + "', CURRENT_TOTAL_COMP = '" + TOTAL_SALARY + "', MATCHED = 1 WHERE MNUMBER = '" + MNUMBER + "' AND SCENARIO = '" + TextBoxSCENARIO.Text + "'", con76);
Not a solution to your question, but another problem you have.
Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens door to a vulnerability named "SQL injection", it is dangerous for your database and error prone.
A single quote in a name and your program crash. If a user input a name like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability, and the crash is the least of the problems, a malicious user input and it is promoted to SQL commands with all credentials.
SQL injection - Wikipedia[
^]
SQL Injection[
^]
SQL Injection Attacks by Example[
^]
PHP: SQL Injection - Manual[
^]
SQL Injection Prevention Cheat Sheet - OWASP[
^]
How can I explain SQL injection without technical jargon? - Information Security Stack Exchange[
^]