AnsweredAssumed Answered

C# Check if SQL query is syntactically correct (Framework 3.5)

Question asked by Jamari_L_Powers on Sep 9, 2014

I am using Visual Studio 2010 (Framework 3.5) ArcMap 10.1. I am developing a project in C# and am having trouble developing a method to check the syntax of an SQL query that is entered in by the user. I have looked at examples and one example in particular involves using:

 

TSql100Parser

IScriptFragment

 

using Microsoft.Data.Schema;

using Microsoft.Data.Schema.ScriptDom.Sql;

using Microsoft.Data.Schema.ScriptDom;

 

These interfaces / references work great (along with some proper coding) and get the job done for users using VS 2010 with Framework 4.0. This is my dilemma. I have to use 3.5. I was wondering if anyone can point me in the right direction on how to implement a method to check to see if a query that a user enters in is syntactically correct. I have also implemented something in a "try...catch" scenario and this works well too, but if there are any other ideas out there, they'd be much appreciated. Thanks for your time. I appreciate any responses or help in advance.

Outcomes