I am adding a multiline SQL code in my C# code like this:
sqlCode = @"SELECT
w.objectID,
w.attr1397 'LastName',
w.attr1395 'FirstName',
w.attr1396 'MiddleName',
w.attr1404 'Gender',
w.attr1436 'OtherName',
convert(varchar,w.attr1402, 101) 'DOB' ,
w.attr1401 'SSN',
d.employmentStatus
FROM [db].[table] w left outer join
(
WHERE w.attr1397 = '" + k + "'
AND
w.attr1395 = c
AND
w.attr1401 = s
ORDER BY 4, 2, 3";
The k, c, and s are variable from the function that I want to use and this is what happens:

How can I resolve it?
SqlCommand.Parametersfor an example. (I'd expect parameterized SQL to be in any reasonable introduction to database access from C#.) Your compile-time error is because your second string literal isn't a verbatim string literal, btw.@for the first string, you are not using it for the second (afterk).SqlCommand.Parametersalready has multiple parameters. You really need to do some research before asking questions.