1

My web application on EC2 is not able to connect to AWS RDS Db instance.

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

I have hosted a web application on EC2.

Usin my local SSMS, I am able to connect and edit data on the AWS RDS.

on my local machine, I also pointed my Visual Studio application to the AWS RDS instance and it worked just fine.

Now, when I deployed my application to EC2, the application is not able to connect to the AWS RDS.

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.

Please help......

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
jaxxbo
  • 7,314
  • 4
  • 35
  • 48

1 Answers1

1

Check the region you are connecting to.

I had initially created, the database in west region. And my local was continuing to connect to west region.

And when I gave all necessary permissions, I gave it to the database in east region. and my code application was still pointing to the west region. duh me.

jaxxbo
  • 7,314
  • 4
  • 35
  • 48