I'm basically tyring to have this sql statement have a value for ZipCode or the word DEFAULT.
public static void AddEmployee(SB oSB)
{
string sSql = "INSERT INTO Employee (EmployeeID,ZipCode) " +
"VALUES (@EmployeeID,@ZipCode); " ;
SqlCommand cmd = new SqlCommand(sSql, GetConnection());
cmd.Parameters.AddWithValue("@EmployeeID", oSB.EmployeeID);
string sZipCode = (oSB.ZipCode == "") ? "DEFAULT":oSB.ZipCode;
cmd.Parameters.AddWithValue("@ZipCode", sZipCode);
...
}
This wont work as the word DEFAULT is a string and not the RESERVED WORD DEFAULT
So...I see from the previously asked question that I cant use the RESERVED WORD DEFAULT as a VALUE. I also saw where you could just rewrite the SQL...that would work but could get hairy with multiple fields.