I have a console application that has Amazon rds connection with Entity Framework . It is running well in my local PC. But When I am running my application in Amazon EC2 It can not connect to my Amazon RDS database and saying 'The underlying provider failed on open' . My connection string of entity framework is ...
<add name="MyEntities" connectionString="metadata=res://*/YhFinModel.csdl|res://*/YhFinModel.ssdl|res://*/YhFinModel.msl;provider=System.Data.SqlClient;provider connection string="data source=datasourcename,portnumber;initial catalog=databasename;persist security info=True;user id=userid;password=password;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
Thanks in advance.
Have you looked at your security groups? I think you will need to add the EC2 security group you are using to have port access to your RDS instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With