c# - Unable to find the requested .Net Framework Data Provider. (SqlClient) -


i trying set simple asp.net mvc 4 webapp using db first migrations sql server (2005). have created tables in database , used entity framework create objects in code. can access data using these objects.

the problems come when try initialize websecurity using websecurity.initializedatabaseconnection("flmrentities", "userprofile", "userid", "username", true); in global.asax.cs file. have tried using initializesimplemembershipattribute filter came template , got same issue. error message:

unable find requested .net framework data provider. may not installed. 

here relevant connection string:

<add name="flmrentities"      connectionstring="metadata=res://*/models.flmr.csdl|res://*/models.flmr.ssdl|res://*/models.flmr.msl;                     provider=system.data.sqlclient;                     provider connection string=&quot;data source=notes.marietta.edu;                         initial catalog=muskwater;                         user id=muskwater;password=********;                         multipleactiveresultsets=true;                         app=entityframework&quot;"       providername="system.data.entityclient" /> 

also, have created membership tables in database match template creates. if change final parameter in initialize call false (so not try create tables automatically) returns cannot find userprofile table. have tried variations on names, such [dbo].[userprofile].

all need have simple account model allow users log in , allow users see more content.

i had similar problem, i've done: modified default connection. had connection string edmx model, looked this:

<add name="chemicalreporterentities" connectionstring="metadata=res://*/chemicaldb.csdl|res://*/chemicaldb.ssdl|res://*/chemicaldb.msl;provider=system.data.sqlclient;provider connection string=&quot;data source=.\sqlexpress;initial catalog=chemicalreporter;integrated security=true;multipleactiveresultsets=true;app=entityframework&quot;" providername="system.data.entityclient" /> 

but cannot used simplememebrship provider. in visual studio opened server explorer > data connections, selected connection, right click, properties , copied connection string there , pasted defaultconnection:

<add name="defaultconnection" connectionstring="data source=.\sqlexpress;initial catalog=chemicalreporter;integrated security=true;multipleactiveresultsets=true;application name=entityframework" providername="system.data.sqlclient" /> 

after changed websecurity.initializedatabaseconnection use defaultconnection.

websecurity.initializedatabaseconnection("defaultconnection", "userprofile", "userid", "username", true); 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -