I am trying to connect to Sybase database from .net core but I do not find any good library. Can someone suggest library to connect to Sybase?
You have a couple of options of connecting to an ASE database in .net core:
System.Data.Odbc
namespace/package on nuget. This package is currently in pre-release and targets .net core 2.0+
.
2.0
or 2.1
then this option is not viable.AdoNetCore.AseClient
namespace/package on nuget.
.net core 1.0
, 1.1
, 2.0
(and 2.1
when it is released), and framework 4.6
. The reason for 4.6
support is so that it can be a drop-in replacement.At the end of the day, both packages implement their flavour of the ADO.NET interfaces (IDbConnection
, IDbCommand
, etc.), so the C# code to set them up will be fairly similar:
//System.Data.Odbc style
using(var connection = new OdbcConnection(...))
using(var commmand = connection.CreateCommand())
{
connection.Open();
//command stuff, note: named parameters unsupported
}
//AdoNetCore.AseClient style
using(var connection = new AseConnection(...))
using(var commmand = connection.CreateCommand())
{
connection.Open();
//command stuff
}