I have to build query string from string values like:
connString += "INSERT INTO (...) VALUES ( "+
_cd.userName "," +
//and there i'd like to use ?: operators:
_cd.lastLogin == "Null" ? "null" : _cd.lastLogin "," 
So my query would look like INSERT INTO (...) VALUES ('name', null, (...))
But when Im using that it cuts my string, so it's look like
",null,1,2,'name', (...)";
Well, I know that I can use var a,b,c,d and then check if (_cd.lastLogin == "Null) a = null and put that into string, but there is many variables.
What is proper way to use it?
@EDIT: Code:
string query =  "INSERT INTO PersonLogin(...) " + Environment.NewLine +
 "VALUES (" + _cD.userID + ","
 + "'" + _cD.number + "',"
 + "'" + _cD.dateCreate + "','"
 + _cD.lastLogin == "Null" ? ",null," : _cD.lastLogin + "',"
 + _cD.taken + ","
 + _cD.canLogin + ""+ Environment.NewLine;
? :.