I am using the following sql in a Maintenance form where add,edit,delete are used. The TermsConcact is the display member of a combobox.
strb.Append("SELECT [TERMSCODE], [TERMSDESCRIPTION], [TERMSPERDISCOUNT], [TERMSDAYS], [TERMSCODE] + ' | '+ [TERMSDESCRIPTION] AS [TERMSCONCAT] FROM [BD_TERMS]");
if (this.radioButton1.Checked) { strb.Append(" ORDER BY [TERMSCODE] "); }
if (this.radioButton2.Checked) { strb.Append(" ORDER BY [TERMSDESCRIPTION] "); }
strb.Append(";");I would like to know if it is possible to write this line in a better way?
Could I pad the [TERMSCODE] to 3 characters when creating the [TERMSCONCACT]?
VS2012