Good day. Colleagues, I have a utilitarian question - for work, you often have to deal with SQL queries written as strings inside a C # code of the following form:

const string query = @"SELECT someField FROM SomeTable"; 

and often these requests are somewhat more complex than the one above. Certainly, the similar approach is fraught with errors which arise already in runtime if, say, in the request a syntactic error was made. Actually, the question is: maybe someone knows some extension for Visual Studio, which allows you to check the syntax of these sql queries directly in the Visual Studio editor?

1 answer 1

You need to create queries like this and check them like this . You can also try LINQ if everything is not very sophisticated there.

  • Unfortunately, this is not about creating, but about supporting one hundred thousand existing requests. I can’t use LINQ either - I’m not able to rewrite a project that has been written for several years - neither DreamChild
  • Then maybe SQL syntax highlighting will save you:… Or with a validator:… - Cyrus
  • Thanks, I hope, will save) - DreamChild