Note that there are some explanatory texts on larger screens.

plurals
  1. POSimpleMembershipInitializer won't initialize
    primarykey
    data
    text
    <p>I am struggling with getting a simplemembership scenario working in my EntityFramework / MVC4 / DatabaseFirst project. I've found plenty of examples for working with code first, but nothing for DB first.</p> <p>The problem I'm encountering is the the InitializeDatabaseConnection is throwing an error ("Unable to find the requested .Net Framework Data Provider. It may not be installed.") The code looks like this :</p> <pre><code>WebSecurity.InitializeDatabaseConnection("DALEntities", "tblContacts1", "ContactID", "EMail", autoCreateTables: true); </code></pre> <p>I am not sure what DataProvider is failing. If I try to trace 'into' the InitializeDatabaseConnection call, it immediately throws the error.</p> <p>What am I missing?</p> <p>Info:<br> DALEntities is the name of the connectionString that the rest of EF uses. The following code works just fine....</p> <pre><code> public ActionResult Test() { using (var db = new DALEntities()) { var query = from i in db.TBLINVENTORies orderby i.ITEMNAME select i; var cnt = query.Count(); string str = "Total Inventory: " + cnt; return Content(str); } } </code></pre> <p>My connection strings section from the web.config:</p> <pre><code> &lt;connectionStrings&gt; &lt;add name="DALEntities" connectionString="metadata=res://*/DAL.DAL.csdl|res://*/DAL.DAL.ssdl|res://*/DAL.DAL.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=SOMECOMPUTER;initial catalog=SOMEDB;persist security info=True;user id=SOMEID;password=SOMEPASS;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt; &lt;/connectionStrings&gt; </code></pre> <p>This post seems to be asking the same question (but in context of model-first), but there is no solution yet : <a href="https://stackoverflow.com/questions/12575311/using-simplemembership-with-ef-model-first">Using SimpleMembership with EF model-first</a></p> <p>Also, I see that there is an overload for <code>WebSecurity.InitializeDatabaseConnection()</code> with the help text: <code>Initializes the membership system ((blah blah &lt;snip&gt; ProviderName: the name of the ADO.NET data provider. If you want to use Microsoft SQL Server, the WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String, String, String, String, Boolean) overload is recommended</code> . I <em>do</em> wish to connect to a MSSQL server...will this be required?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload