title: Connect To Redshift VPC C#
body: <p>Not to come off as a total idiot here.  I'm a .NET SQL Server guy trying to programmatically connect to AWS Redshift through C# for the first time and am having an impossible time getting a connection. I honestly dont know a lot about AWS so perhaps this is really obvious as to what my problem is.  Here is my code:</p>
  
  <pre><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();
      }
  
  
  }
  </code></pre>
  
  <p>Whenever I instantiate Redshift, I get:</p>
  
  <p>Failed to establish a connection to 'xxx.xxxxxxx.us-east-1.redshift.amazonaws.com. </p>
  
  <p>Setting the inbound rule of the default VPC Security Group to accept All Traffic 0.0.0.0/0 didnt make a difference.</p>