Skip to content

Connecting to redis datatbase using Redis SQL ODBC driver in DSN less connection Getting issue #7

@Ajay7112

Description

@Ajay7112

Hi Team,
I am encountering the following issue while configuring a DSN-less connection in a console application. I used the connection string below:
connectionString = "Driver={Redis};Server=127.0.0.1;Port=6379;Database=0;";

However, when using a DSN connection, it works fine:
connectionString = "DSN=Redis;UID=default;PWD=none;";

Could you please share a solution to fix this issue?
Error when using direct URL for connection:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:

at Interop+Odbc.SQLDriverConnectW(System.Data.Odbc.OdbcConnectionHandle, IntPtr, System.String, Int16, IntPtr, Int16, Int16 ByRef, Int16)

at System.Data.Odbc.OdbcConnectionHandle.Connect(System.String)
at System.Data.Odbc.OdbcConnectionHandle..ctor(System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcConnectionString, System.Data.Odbc.OdbcEnvironmentHandle)
at System.Data.Odbc.OdbcConnectionOpen..ctor(System.Data.Odbc.OdbcConnection, System.Data.Odbc.OdbcConnectionString)
at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Object, System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionPoolGroup, System.Data.Common.DbConnectionOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal, System.Data.ProviderBase.DbConnectionInternal ByRef) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource1<System.Data.ProviderBase.DbConnectionInternal>, System.Data.Common.DbConnectionOptions)
at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory)
at System.Data.Odbc.OdbcConnection.Open()
at ODBCConnector.Program.GetDataUsingODBC()
at ODBCConnector.Program.Main(System.String[])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions