3

I am building webform using vs2012 Express. I am using the ASP.NET Membership provider.
In configuring the sqlmembershipprovider, I ran the following sql batch on my db.

\WINDOWS\Microsoft.NET\Framework\v4.030319\InstallCommon.sql
\WINDOWS\Microsoft.NET\Framework\v4.030319\InstallMembership.sql    

to install the Membership.When i tried to Register new user on my application I received the following Error Message:

Exception Details:
System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1769462
 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5318578
.......

Going through the trace and Answers on similar question posted on stack overflow, I notice that I run the two sqlbatches on a wrong db:A. I created similar table on db:A and change the connection string in the web congfig. it works.But the db:B am working on is where I want install the membership, when I ran the same sqlbatches on this db:B the necessary objects are not installed.Both databases are on the same server.
Did any know why and what should i do next?

1 Answer 1

6

The correct method of setting up the membership provider database is to run the asp.net reg tool. It can be found in the location below:

"C:\Windows\Microsoft.NET\Framework\<FrameworkVersion>\aspnet_regsql.exe"

More information http://msdn.microsoft.com/en-us/library/x28wfk74(v=vs.100).aspx

2
  • Thanks @Spike.This is very fast and easy.My Registration works now
    – kombo
    Commented Dec 28, 2012 at 13:10
  • Note: this also works for LocalDb - just enter "(LocalDb)\MSSQLLocalDB" and select windows authentication. Commented Jul 6, 2017 at 18:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.