Don't come off like a complete idiot here. I'm the .NET SQL Server guy trying to programmatically connect to AWS Redshift via C # for the first time, and I have an impossible time to get the connection. I honestly don't know much about AWS, so perhaps this is really obvious in relation to my problem. Here is my code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Data;
using Npgsql;
public class Redshift
{
private readonly NpgsqlConnection _connection;
private string _connectionString
{
get
{
NpgsqlConnectionStringBuilder builder = new NpgsqlConnectionStringBuilder();
builder.Host = "xxx.xxxxxxxx.us-east-1.redshift.amazonaws.com";
builder.Port = 5439;
builder.UserName = "xxxx";
builder.Password = "xxxx";
return builder.ConnectionString;
}
}
public Redshift()
{
_connection = new NpgsqlConnection(_connectionString);
_connection.Open();
}
}
Whenever I create Redshift, I get:
Failed to establish connection with 'xxx.xxxxxxx.us-east-1.redshift.amazonaws.com.
Setting the inbound rule for the VPC default security group to accept All Traffic 0.0.0.0/0 did not affect.
source
share