title: AWS EC2 Could not open a connection to SQL Server
body: <p>My web application on EC2 is not able to connect to AWS RDS Db instance.</p>
  
  <pre><code>error: SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
  
  Win32Exception (0x80004005): The network path was not found
  </code></pre>
  
  <p>I have hosted a web application on EC2.</p>
  
  <p>Usin my local SSMS, I am able to connect and edit data on the AWS RDS.</p>
  
  <p>on my local machine, I also pointed my Visual Studio application to the AWS RDS instance and it worked just fine.</p>
  
  <p>Now, when I deployed my application to EC2, the application is not able to connect to the AWS RDS.</p>
  
  <p>Using the AWS Toolkit for net, I have added permissions to the DB Security groups and granted rights to the EC2 Ip address and Private Ip as well. But no luck.</p>
  
  <p>Please help......</p>