Saturday, 16 June 2012

Entity SQL and curly brackets


I came across this while working with ESQL. You may be trying to create a query as

String query = string.Format(“select a,b from tablename where a in {{0}}”, variablename)

This will not work as curly brackets needs to be escaped.

The easiest way to escape them is to add another curly brackets around the {0}, so it becomes {{{0}}}

Awkward, but works!


No comments:

Post a Comment