I use the following library to access a Sybase IQ database.
https://github.com/DataAction/AdoNetCore.AseClient
However, it got the following error. It seems the char type causes the error.
using var conn1 = new AseConnection(connString);
using var cmd1 = new AseCommand(sql, conn1) { CommandTimeout = 300 };
conn1.Open();
var reader1 = cmd1.ExecuteReader(); // ERROR!
System.NotSupportedException HResult=0x80131515 Message=Unsupported data type 32 (column: ) Source=AdoNetCore.AseClient StackTrace: at AdoNetCore.AseClient.Internal.FormatItem.ReadTypeInfo(FormatItem format, Stream stream, Encoding enc) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Internal\FormatItem.cs:line 252 at AdoNetCore.AseClient.Internal.FormatItem.ReadForParameter(Stream stream, Encoding enc, TokenType srcTokenType) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Internal\FormatItem.cs:line 174 at AdoNetCore.AseClient.Token.ParameterFormatCommonToken.Read(Stream stream, DbEnvironment env, IFormatToken previousFormatToken) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Token\ParameterFormatCommonToken.cs:line 62 at AdoNetCore.AseClient.Token.ParameterFormat2Token.Create(Stream stream, DbEnvironment env, IFormatToken previous) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Token\ParameterFormat2Token.cs:line 16 at AdoNetCore.AseClient.Internal.TokenReader.d__0.MoveNext() in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Internal\TokenReader.cs:line 21 at AdoNetCore.AseClient.Internal.InternalConnection.InternalExecuteQueryAsync(AseCommand command, AseTransaction transaction, TaskCompletionSource`1 readerSource, CommandBehavior behavior) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Internal\InternalConnection.cs:line 344 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at AdoNetCore.AseClient.Internal.InternalConnection.ExecuteReader(CommandBehavior behavior, AseCommand command, AseTransaction transaction) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\Internal\InternalConnection.cs:line 476 at AdoNetCore.AseClient.AseCommand.ExecuteReader(CommandBehavior behavior) in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\AseCommand.cs:line 179 at AdoNetCore.AseClient.AseCommand.ExecuteReader() in C:\gitprojects\AdoNetCore.AseClient_master\src\AdoNetCore.AseClient\AseCommand.cs:line 193 at ArchiveHistorical.Program.Download(SybaseConn con, String sql, String filename) in C:\Users\abcd\source\repos\ArchiveHistorical\ArchiveHistorical\Program.cs:line 39 at ArchiveHistorical.Program.Main(String[] args) in C:\Users\abcd\source\repos\ArchiveHistorical\ArchiveHistorical\Program.cs:line 29 This exception was originally thrown at this call stack: AdoNetCore.AseClient.Internal.FormatItem.ReadTypeInfo(AdoNetCore.AseClient.Internal.FormatItem, System.IO.Stream, System.Text.Encoding) in FormatItem.cs AdoNetCore.AseClient.Internal.FormatItem.ReadForParameter(System.IO.Stream, System.Text.Encoding, AdoNetCore.AseClient.Enum.TokenType) in FormatItem.cs AdoNetCore.AseClient.Token.ParameterFormatCommonToken.Read(System.IO.Stream, AdoNetCore.AseClient.Internal.DbEnvironment, AdoNetCore.AseClient.Interface.IFormatToken) in ParameterFormatCommonToken.cs AdoNetCore.AseClient.Token.ParameterFormat2Token.Create(System.IO.Stream, AdoNetCore.AseClient.Internal.DbEnvironment, AdoNetCore.AseClient.Interface.IFormatToken) in ParameterFormat2Token.cs AdoNetCore.AseClient.Internal.TokenReader.Read(AdoNetCore.AseClient.Internal.TokenReceiveStream, AdoNetCore.AseClient.Internal.DbEnvironment) in TokenReader.cs AdoNetCore.AseClient.Internal.InternalConnection.InternalExecuteQueryAsync(AdoNetCore.AseClient.AseCommand, AdoNetCore.AseClient.AseTransaction, System.Threading.Tasks.TaskCompletionSource, System.Data.CommandBehavior) in InternalConnection.cs System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() AdoNetCore.AseClient.Internal.InternalConnection.ExecuteReader(System.Data.CommandBehavior, AdoNetCore.AseClient.AseCommand, AdoNetCore.AseClient.AseTransaction) in InternalConnection.cs AdoNetCore.AseClient.AseCommand.ExecuteReader(System.Data.CommandBehavior) in AseCommand.cs AdoNetCore.AseClient.AseCommand.ExecuteReader() in AseCommand.cs ... [Call Stack Truncated]
Is it bug? Is there any options to access Sybase database from .Net (core or non-core) without install any additional driver? (or and free driver)
User contributions licensed under CC BY-SA 3.0