I am new to asp.net, and I am now facing a problem.
I have created a project using asp.net mvc4, and I have added an entity data model and successfully connected to MySQL. but when I tried to create a controller, I got the error message stated as below:
"unable to retrieve metadata for "client_test.client", Unable to find the requested .NET Framework data provider. it may not be installed."
from the "scaffolding options", I choose the template:
"MVC controller with read/write actions and views using Entity Framework"
and from the machine.config file, I could see MySQL data provider is there.
<DbProviderFactories>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
and the connectionString in the web.config is like this:
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-client_test-20130916144039;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-client_test-20130916144039.mdf" providerName="System.Data.SqlClient" />
<add name="Client_infoEntities" connectionString="metadata=res://*/clientDatabase.csdl|res://*/clientDatabase.ssdl|res://*/clientDatabase.msl;provider=MySql.Data.MySqlClient;provider connection string="server=127.0.0.1;user id=root;password=itplustest;persist security info=True;database=Client_info"" providerName="System.Data.EntityClient" />
</connectionStrings>
and also I have added the code below to the web. config:
<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
My connector/net version is 6.7.4.0 and i have MySQL for Visual Studio 1.0.2, I hope you guys could help me to solve my problem.
Thanks JY