C# Programming
07-24-2009, 10:50 PM
Hi all,
I'm trying to open a SQL Anywhere DB connection and setup a data reader with the data returned, only I keep getting the error:
'oConn.ServerVersion' threw an exception of type 'System.InvalidOperationException'
Here is my code:
string ConnString = "Data Source=***;UID=***;PWD=***";
SAConnection oConn = new SAConnection(ConnString);
oConn.Open();
string SQLStatement = "SELECT * FROM QAS.QAFISET WHERE MAINLVL='T' ORDER BY NAME";
SACommand command = new SACommand(SQLStatement, oConn);
SADataReader DRTest = command.ExecuteReader();
Any feedback would be greatful.
Thank you,
Mel
modified on Friday, July 24, 2009 2:25 PM
I'm trying to open a SQL Anywhere DB connection and setup a data reader with the data returned, only I keep getting the error:
'oConn.ServerVersion' threw an exception of type 'System.InvalidOperationException'
Here is my code:
string ConnString = "Data Source=***;UID=***;PWD=***";
SAConnection oConn = new SAConnection(ConnString);
oConn.Open();
string SQLStatement = "SELECT * FROM QAS.QAFISET WHERE MAINLVL='T' ORDER BY NAME";
SACommand command = new SACommand(SQLStatement, oConn);
SADataReader DRTest = command.ExecuteReader();
Any feedback would be greatful.
Thank you,
Mel
modified on Friday, July 24, 2009 2:25 PM