Using verbatim strings for SQL queries can make your code much more readable. For example, which one of the following queries is easier to read?
This one?
string query = @" SELECT User.FirstName, User.LastName, User.Age, User.Gender, User.HairColor, Adress.Street, Adresse.Zip, Adress.City, Adress.Country FROM User INNER JOIN Adress ON User.AdressId = Adress.Id SORT BY User.FirstName, User.LastName ";
or this one?
string query = "SELECT User.FirstName, User.LastName, User.Age, " + "User.Gender, User.HairColor, Adress.Street, Adresse.Zip, " + "Adress.City, Adress.Country FROM User INNER JOIN Adress ON " + "User.AdressId = Adress.Id SORT BY User.FirstName, " + "User.LastName";
The SQL engine doesn’t care for the whitespace you introduce in queries with verbatim strings. So do your fellow programmers a favor and use them for your SQL queries!