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 an error in the image
source share