I am building a Xamarin.Mac
application (C#) which needs to connect to an AWS RDS MySQL database.
I have the code:
using (SqlConnection connection = new SqlConnection(ConnectionString))
{
connection.Open();
using (SqlCommand command = new SqlCommand("SELECT * FROM store", connection))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine("{0} {1} {2}",
reader.GetInt32(0), reader.GetString(1), reader.GetString(2));
}
}
}
Where my connection string is of the format:
ConnectionString = "Server={0};Database={1}Uid={2};Pwd={3}";
However, I can't seem to connect. Yet, using the same host and credentials via MySqlWorkbench, I can connect just fine. I saw that my RDS instance was build with the setting Certificate Authority set to rds-ca-2015
(there is no option to not set it as this).
How can I connect to this RDS DB using the C# code above?