Entity framework with MySQL -


hello installed mysql connector/net 6.7.4 able generate edmx mysql database, wanna smth added connetion string , :

    <dbproviderfactories>   <add name="mysql data provider" invariant="mysql.data.mysqlclient" description=".net framework data provider mysql" type="mysql.data.mysqlclient.mysqlclientfactory, mysql.data, version=6.7.4.0, culture=neutral, publickeytoken=c5687fc88969c44d"/> </dbproviderfactories> 

in webconfig, when create context(pure generated .tt) got exception on collection:

the specified store provider cannot found in configuration, or not valid.

any ideas why? added mysql.xxx dlls bin

edit: connstring wrong when modified provider name looks now:

<connectionstrings> <add name="classicmodelsentities" connectionstring="metadata=res://*/mysql.model1.csdl|res://*/mysql.model1.ssdl|res://*/mysql.model1.msl;provider=mysql.data.mysqlclient;provider connection string=&quot;server=localhost;user id=root;password=password;persist security info=true;database=classicmodels&quot;" providername="mysql data provider"/> 

i got exception :unable find requested .net framework data provider. may not installed.

if using entity framework, why adding connection string? connection string generated me different:

<add name="stuffentities"       connectionstring="metadata=res://*/entities.mymodel.csdl|res://*/entities.mymodel.ssdl|res://*/entities.mymodel.msl;provider=mysql.data.mysqlclient;provider connection string=&quot;server=myserver.com;user id=my_user;password=my_password;persistsecurityinfo=true;database=db_example&quot;"       providername="system.data.entityclient" /> 

add mysql references on references, true local copy. add required configuration in web.config, installing through nuget missing package.

to this, right click solution or project, click on manage nuget packages, , install missing mysql.data reference. should modify web.config reference.


Comments