Connect to Nexus DB using ODBCConnection in dotnetcore

I am trying to connect to NexusDB using in namespace . I can run the same code on my machine using a running console application . I have a NexusDB V3.09 driver installed on my machine. ODBCConnection System.Data.Odbc .NetFramework 4.6.1

Below is my code:

string conns = "DRIVER={NexusDB V3.09 Driver};Transport=TCP;SERVER=NexusDB@ipAddressValue;PORT=16000;DataBase=DBName;";

        using (var conn = new OdbcConnection(conns))
        {

            string maxNumberQuery = "SELECT MAX(NUMBER) FROM CLIENT";
            OdbcCommand oCmd = new OdbcCommand(maxNumberQuery, conn);
            conn.Open();
            result = (int)oCmd.ExecuteScalar();

        }

When I try to use a console application to open a connection, I get this error: DotNetCore

[IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and specified driver not specified by default

+4
source share

Source: https://habr.com/ru/post/1691457/


All Articles