I am using following c# code to query a Sybase database(driver - Adaptive Server Enterprise). -
string query = “select * from view_Test”;
DataTable dt = new DataTable();
OdbcConnection con = new OdbcConnection();
con.ConnectionString = connStr;
OdbcCommand selectCommand = new OdbcCommand(query, con);
OdbcDataAdapter dataAdatper = new OdbcDataAdapter(selectCommand);
dataAdatper.Fill(dt);
dt is getting populated but at the same time this code is throwing following exception -
System.Data.Odbc.OdbcException occurred
HResult=-2146232009
Message=""
Source=""
ErrorCode=-2146232009
if I select columns that do not have any null values or not Boolean, then the same code does not throw any exception.
But when I use DDTek.Sybase or Sybase.AdoNet4.AseClient dlls, the same code(class names are replaced by dll specific class names.eg, OdbcConnection is replaced by AseConnection) works.
Please help to resolve this issue