Link to home
Start Free TrialLog in
Avatar of fairway01
fairway01

asked on

Conditional operator error with c# code on a DB update statement

I am receiving a CS1002: ; expected error with my c# code when writing a sql update statement that joins many lines of code together.  The problem line is the second one in my code example 'BD1'  Can someone assist with formatting of this line?  

NOTE: When I preview my question, I have a plus sign at the end of each line to string the lines of code together, but they are being removed.
"Last1 = '"+LName1.Text.Replace("'", "''") + "', " +
"BD1 = " string.IsNullOrEmpty(BD1.Text) == true ? "null, " + : "'"+BD1.Text.Replace("'", "''") + "', " +;
"First2 = '"+FName2.Text.Replace("'", "''") + "', " +

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial