I currently have an application which uses EF database first which was built against SQL Server database. I would like to allow the ability to connect to either MSSQL or MySQL.
I assumed that by using EF I could just change the connection string to point to MySQL, however, when I do that I get the following error:
Unable to cast object of type 'MySql.Data.MySqlClient.MySqlConnection' to type 'System.Data.SqlClient.SqlConnection'.
What other steps are needed to make EF work with MySQL and MSSQL.
Update: Connection String:
<add name="EntityConnString" connectionString="metadata=res://*/Entities.csdl|res://*/Entities.ssdl|res://*/Entities.msl;provider=MySql.Data.MySqlClient;
provider connection string="server=localhost;User Id=root;password=password;Persist Security Info=True;database=mydb;Connection Protocol=NamedPipe"" providerName="System.Data.EntityClient" />