0

I am currently formatting my SQL queries like this in C#:

  string query = "SELECT * "+
                   "FROM product p"+
                   "JOIN order o ON p.productID = o.productID";

Is there any alternative ways to achieve the above format without using the + sign?

3
  • 3
    Put it in a resource file ... use stored procedures ... use an ORM ... Commented Oct 24, 2013 at 9:08
  • I use ORM for large projects. Commented Oct 24, 2013 at 9:15
  • 1
    @ta.speot.is why would you intentionally make it harder to maintain? Commented Oct 24, 2013 at 9:24

1 Answer 1

8

Use the @ symbol:

string query= @"SELECT *  
                  FROM product p 
                  JOIN order   o ON p.productID = o.productID";
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.