I have an MVC 3 web application using Entity Framework to access the projects database. However, the project also uses a second database for Memberships called ApplicationServices. The MvcMembership package uses this database for authentication purposes. Now, I added a custom stored procedure in the ApplicationServices database that I would like to call from my application. How can I do that?
I guess I could do so by using the Membership Provider, but I am not sure how to do so.
Here is how it is defined in my Web.config file:
<add name="ApplicationServices" connectionString="Data Source=.\SQLEXPRESS;Persist Security Info=false; Initial Catalog=ApplicationServices; User ID=******; Password=******" />
...
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" ... applicationName="/" />
</providers>
</membership>
No you can’t call it from the default
SqlMembershipProviderbecause this is a custom Stored Procedure and the Membership Provider know nothing about it.Anyway you still could access this stored procedure like normal. Or you may make custom
MembershipProviderand use this StoredProcedure in it. It depends on what and why you use this StoredProcedure