Closed tomerpeled closed 7 years ago
ResourceSetLoadingFailed:Unable to cast object of type 'MySql.Data.MySqlClient.MySqlConnection' to type 'System.Data.SqlClient.SqlConnection'.
also from config doesn't work for me
Please show your code...
i have
`
and conn string as
<add name="mySqlConnection" connectionString="server=localhost;port=3306;user id=user;password=pwd;database=localizations" providerName="MySql.Data.MySqlClient" />
create table works but select insert doesn't
do you have some limitations on mysql connectors or there is a bug? i cloned solution and did few debug and seems that data.executeReader gives null at first call but at second call i got some data. Where the issue can be?
in my solution it seems to work without that default and force get provider from connString
@@ -54,7 +54,7 @@ namespace Westwind.Utilities.Data
public SqlDataAccess(string connectionString)
: base(connectionString, SqlClientFactory.Instance)
: base(connectionString)
{ }
That code looks like it's hitting the SQL Server provider. Are you shure you're setting hte provider in the configuration?
If you are running the preview you might want to try this again with the beta. There were a lot of broken bits in the preview related to non-SQL server providers that have now been addressed. Make sure to re-read the configuration section for SQL providers.
Hi,
I succeed to work with the MySQL provider while defining it via the web.config like this:
But when trying to override it via code it doesn't work:
Notice that when working with:
DbResourceConfiguration.Current.ConnectionString = "Localization";
Instead of overriding the connectionString it works...The SQL server provider is working in both scenarios (Config + override in code).
Anything I'm missing?