1
votes

Having a problem here, I'm trying to query a database and when I go to select something from that query I get this error

Schema specified is not valid. Errors:

Models.Context.AdaptEntities.ssdl(2,58) : error 0172: All SSDL artifacts must target the same provider. The Provider 'MySql.Data.MySqlClient' is different from 'MySql.Data.MySqlClient' that was encountered earlier.

Models.Context.AdaptEntities.ssdl(2,91) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '5.6' that was encountered earlier.

Models.Context.Unitemps.ssdl(2,54) : error 0172: All SSDL artifacts must target the same provider. The Provider 'MySql.Data.MySqlClient' is different from 'MySql.Data.MySqlClient' that was encountered earlier.

Models.Context.Unitemps.ssdl(2,87) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '5.6' that was encountered earlier.

Anyone know a solution at all?

1
How are your providers set up in your config (probably web.config) file? - Yuck

1 Answers

0
votes

The issue is that you are not targeting the correct version of MySQL.

First thing is to check that the Entity Framework target for the Transact-SQL query based on the MySQL version that is specified in the ProviderManifestToken attribute of the Schema element in the storage model (.ssdl) file.

This version might differ from the version of the actual MySQL you are connected to.

This is a known issue for Entity Framework... Taken from here

"Certain database behaviors depend on the compatibility level set to the database. If your ProviderManifestToken attribute is set to 2005 and your SQL Server version is 2005, but the compatibility level of a database is set to "80" (SQL Server 2000), the generated Transact-SQL will be targeting SQL Server 2005, but might not execute as expected due to the compatibility level setting. For example, you might lose ordering information if a column name in the ORDER BY list matches a column name in the selector."

As a workaround: Open the Entity Framework .edmx file and manually change the ProviderManifestToken. This should, once compiled, change the manifest token specified in the ssdl file (use for offline).