'How to connect to Sybase database from .net core

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?



Solution 1:[1]

I've used MSA.NetCore.ODBC with Dapper for my test .Net Core 2.0 project.

using System.Collections.Generic;
using System.Data;
using System.Data.Odbc;
using Dapper;

...
public IEnumerable<Book> GetBooks()
{
    using (IDbConnection dbConnection = new OdbcConnection("{your_db_connection}"))
    {
        IEnumerable<Book> books = dbConnection.Query<Book>("select * from books");

        return books;
    }
}

Solution 2:[2]

There is a new SQL Anywhere driver for .NET Core. Support for EF Core is unfortunately still missing.

The following is the entry from SAP:

SQL Anywhere .NET Core Data Provider The SQL Anywhere Provider for .NET Core is an ADO.NET driver that provides data access from .NET Core applications to SAP SQL Anywhere databases.

The driver is Sap.Data.SQLAnywhere.Core.v2.1.dll and is available on Microsoft Windows. It is included in the SAP SAP IQ Database Client.

ADO.NET Support Most ADO.NET features are supported by the provider. The following ADO.NET functionality is not available for .NET Core:

  • Distributed transaction enlistment with a transaction coordinator
  • SACredential class
  • SAConnection( string connectionString,SACredential credential) method
  • SAPermission class
  • SAFactory.CreatePermission method
  • Entity Framework

https://help.sap.com/viewer/a894a54d84f21015b142ffe773888f8c/16.1.5.0/en-US/81e7c7253f0b42a0b8fb0f6f8a30de2d.html

Solution 3:[3]

Could you use the ODBC driver that comes with the Sybase client or Sybase SDK for Developers?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ivan Shevtsiv
Solution 2 gutzi
Solution 3 Vince