title: Find position of a SQL Syntax Error from System.Data.ODBC.ODBCException?
body: <p>The Goal of my program is to allow our support technicians to run queries on a Faircom, c-tree Plus database while logged in as a user with limited rights.</p>
  
  <p>I have the program running and, as long as their script is good, it's just fine. </p>
  
  <p>But when they have the wrong table, column or, even worse, a syntax error; the information available in the System.Data.ODBC.ODBCException doesn't seem to give me the ability to tell the user what line/position in their script they need to focus their attention.</p>
  
  <p>Line that throws the error:</p>
  
  <pre><code>OdbcDataReader reader = command.ExecuteReader();
  </code></pre>
  
  <p>Exception.Message:</p>
  
  <pre><code>ERROR [2a504] [FairCom][ODBC FairCom Driver 9.3.55632(Build-110208_120517)][ctreeSQL] -20003 Syntax error
  </code></pre>
  
  <p>Exception.Source:</p>
  
  <pre><code>CTODBC9.DLL
  </code></pre>
  
  <p>Exception.StackTrace:</p>
  
  <pre><code>at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
     at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
     at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
     at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior)
     at System.Data.Odbc.OdbcCommand.ExecuteReader()
     at QueryDentrixDatabase.Form1.RunQuery(String query) in C:\Users\caanderson\Documents\Visual Studio 2010\Projects\...\Form1.cs:line 193
  </code></pre>
  
  <p>I would really like to give more information than "Syntax Error"</p>