I'm getting this odd error when my C# .NET 4.6.2 application makes a call to OdbcCommand.ExecuteReader(). The connection to the server is successful, and I can verify in the debugger that OdbcConnection.Status is Open. Here is my code, followed
by the stack trace I get when the error occurs. Any help would be great. Thanks.
this._connection = new OdbcConnection(connectionString);
this._connection.Open();
OdbcCommand cmd = new OdbcCommand(queryString, this._connection);
OdbcDataReader reader = cmd.ExecuteReader(); // error occurs here
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 FactoryTestTool.Modules.MySQL.MySQLConnector.Select(MySQLQuerySelect query) in C:\Projects\dotnet-C-Sharp-FactoryTestTool\trunk\Code\FactoryTestTool\FactoryTestTool\Modules\MySQL\MySQLConnector.cs:line 120
at FactoryTestTool.FormFactoryTestTool.buttonLogin_Click(Object sender, EventArgs e) in C:\Projects\dotnet-C-Sharp-FactoryTestTool\trunk\Code\FactoryTestTool\FactoryTestTool\FormFactoryTestTool.cs:line 637
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at FactoryTestTool.Program.Main(String[] args) in C:\Projects\dotnet-C-Sharp-FactoryTestTool\trunk\Code\FactoryTestTool\FactoryTestTool\Program.cs:line 90