Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data source name not found and no default driver specified (using Amazon Redshift (x64))

private OdbcConnection _internalConnection;
        public OdbcConnection InternalConnection
        {
            get
            {
                if (_internalConnection == null)
                {
                    Open();
                }
                return _internalConnection;
            }
        }

        public void Open()
        {
            _internalConnection = new OdbcConnection(CreateConnectionString());

            try
            {
                if (_internalConnection.State == System.Data.ConnectionState.Closed)
                    _internalConnection.Open();
            }
            catch
            {
                throw;
            }
        }

        private string CreateConnectionString()
        {

            int endpointPort = 5439;

            string driver = "{Amazon Redshift (x64)}";
            string connectionString = "Driver={0};Server={1};Database={2};UID={3};PWD={4};Port={5};SSL=true;Sslmode=Require";

            connectionString = string.Format(connectionString,
                driver,
                Parameters[ConnectionParameterType.DataSource],
                Parameters[ConnectionParameterType.DatabaseName],
                Parameters[ConnectionParameterType.UserName],
                Parameters[ConnectionParameterType.Password],
                endpointPort);

            return connectionString;
        }

see error in image

like image 501
Amit Kumar Avatar asked Dec 08 '16 10:12

Amit Kumar


People also ask

How do I fix data source name not found and no default driver specified?

You can check the drivers which are installed on your system by going to the ODBC Data Source Administrator. To open it, press ⊞ Win + R , and type in: odbcad32.exe . Then check the tab Drivers for installed drivers. The Name column indicates the exact name you should use in your connection string or DSN.

How do I install a redshift driver?

Amazon Redshift ODBC Driver (32-bit) Choose the System DSN tab to configure the driver for all users on the computer, or the User DSN tab to configure the driver for your user account only. Choose Add. The Create New Data Source window opens. Choose the Amazon Redshift ODBC driver, and then choose Finish.

How do I check my redshift ODBC driver version?

Windows: From the Start menu, navigate to ODBC Data Sources, and then choose the Drivers tab. Locate the Amazon Redshift ODBC Driver from the list of installed ODBC drivers. The version number appears in the Version column.

What is Amazon redshift ODBC driver used for?

The Amazon Redshift ODBC Driver is a powerful tool that allows you to connect with live Amazon Redshift data, directly from any applications that support ODBC connectivity. Read, write, and update Amazon Redshift data through a standard ODBC Driver interface.


1 Answers

install 32 bit driver

https://s3.amazonaws.com/redshift-downloads/drivers/AmazonRedshiftODBC32-1.3.1.1000.msi

and replace string driver with

string driver = "{Amazon Redshift (x86)}";

like image 102
ER.SHASHI TIWARI Avatar answered Oct 30 '22 16:10

ER.SHASHI TIWARI