Click here to Skip to main content
15,034,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone

I am new one to MVC4....I generated model classes from database using Entity Framework in my application and when ever i am trying to registering new user it giving error like this.....

in my InitializeSimpleMembershipAttribute.cs class

C#
public override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          // Ensure ASP.NET Simple Membership is initialized only once per app start
          LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
      }

      private class SimpleMembershipInitializer
      {
          public SimpleMembershipInitializer()
          {
              Database.SetInitializer<EMedExEntities>(null);

              try
              {
                  using (var context = new EMedExEntities())
                  {
                      if (!context.Database.Exists())
                      {
                          // Create the SimpleMembership database without Entity Framework migration schema
                          ((IObjectContextAdapter)context).ObjectContext.CreateDatabase();
                      }
                  }

                  WebSecurity.InitializeDatabaseConnection("EMedExEntities", "EMedExAdminProfile", "Admid", "Admlogin", autoCreateTables: true);
              }
              catch (Exception ex)
              {
                  throw new InvalidOperationException("The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588", ex);
              }
          }
      }


System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.

Source Error: 
                  WebSecurity.InitializeDatabaseConnection("EmployeeEntities", "Students", "Id", "FirstName", autoCreateTables: true);
                 }


how can i configure the simple member ship in my application. please help me
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900