Connecting to Nexus DB using ODBCConnection in dotnetcore

891 views Asked by At

I am trying to connect to NexusDB using ODBCConnection in System.Data.Odbc namespace. I am able to run the same piece of code on my machine using .NetFramework 4.6.1 console app which is working. I have NexusDB V3.09 Driver installed on my machine.

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 the DotNetCore console app to open a connection, I get this error:

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

0

There are 0 answers