dotancohen
dotancohen

Reputation: 31481

Visual Studio: newlines in SQL

Is there any way to use newlines in SQL queries in Visual Studio 2010 Express Edition? Whenever I organize my queries with newlines for readability Visual Studio highlights the code as error and the project fails to build (without even mentioning the reason, just a "No source available message"). However, I simply remove the newlines and it builds.

Thank you.

Upvotes: 1

Views: 135

Answers (1)

Thit Lwin Oo
Thit Lwin Oo

Reputation: 3438

Try this way..

    string sql = @"SELECT ID, NAME
                 FROM TABLE
                 WHERE ID = '1'
                ";

Upvotes: 4

Related Questions