environment: asp.net 2.0, vb, sql server 2000, windows server 2003.
Currently when I try to test to enter information through a CreateUserWizard this error pops up, I have checked my databases and I do have a aspnet_SchemaVersion there, I checked around the net and on the forums and I fixed any problems I thought could be causing it, I gave network services rights, as well as my sql server login, I have both a membership and a schemaversion table in the database.
I ran aspnet_regsql.exe to make a new target for my <forms> login, I just don't see what the problem is and can't seem to find anything out there that is the same as my problem. The following is the web.config:
<configuration>
<appSettings>
<add key="ConnectionString" value="DataSource=mew@.mew.com;UID=mew;pwd=mewmew" />
<add key="ConnectionString" value="Server=xxxxxxxxxx;database=customerlogin;UID=xxxxxxxxx;pwd=xxxxxxxx;Trusted_Connection=True" />
</appSettings>
<connectionStrings>
<add name="SqlServerConnection" connectionString="Server=xxxxxxxxxx;database=customerlogin;UID=xxxxxxxxxx;pwd=oni@.ichi;Trusted_Connection=True" />
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=xxxxxxxxxx;Integrated Security=SSPI;Initial Catalog=customerlogin;UID=xxxxxxxxx;pwd=xxxxxxxxx;Trusted_Connection=True" />
</connectionStrings>
<location path="secret">
<system.web>
<webParts>
<personalization defaultProvider="MyPersonalizationProvider">
<providers>
<membership defaultProvider="MyMembership">
<add name="MyMembership" type="System.UI.WebControls.WebParts.SqlPersonalizationProvider" connectionStringName="SqlServerConnection" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" requiresPassword="false" />
</membership>
</providers>
<authorization>
<deny users="?" />
</authorization>
</personalization>
</webParts>
<authentication mode="Forms" />
</system.web>
</location>
</configuration>
and this is the register.aspx page:
<%@. Page Explicit="true" debug="true" language="vb" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%@. Import Namespace="System.Data.Mail" %>
<%@. Import Namespace="System.Net.Mail" %>
<%@. Import Namespace="System.Web.Configuration" %>
<script runat="server">
Sub Page_Load()
If Not Page.IsPostBack Then
Dim dest As String = "~/Default.aspx"
If Not String.IsNullOrEmpty(Request.QueryString("ReturnURL")) Then
dest = Request.QueryString("ReturnURL")
CreateUserWizard1.ContinueDestinationPageUrl = dest
End If
End If
End Sub
Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As EventArgs)
CreateUserProfile(CreateUserWizard1.UserName, txtFirstName.Text, txtLastName.Text)
End Sub
Private Sub CreateUserProfile(ByVal userName As String, ByVal firstName As String, ByVal lastName As String)
Dim conString As String = WebConfigurationManager.ConnectionStrings("Test").ConnectionString
Dim con As New SqlConnection(conString)
Dim cmd As New SqlCommand("INSERT Test (UserName,FirstName,LastName) VALUES (@.UserName,@.FirstName,@.LastName)",con)
cmd.Parameters.AddWithValue("@.UserName", userName)
cmd.Parameters.AddWithValue("@.FirstName", firstName)
cmd.Parameters.AddWithValue("@.LastName", lastName)
Using con
con.Open()
cmd.ExecuteNonQuery()
End Using
End Sub
</script>
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<form runat="server" id="form1">
<asp:CreateUserWizard id="CreateUserWizard1" OnCreatedUser="CreateUserWizard1_CreatedUser" Runat="server" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" requiresPassword="false">
<WizardSteps>
<asp:WizardStep>
<asp:Label id="lblFirstName" Text="First Name:" AssociatedControlID="txtFirstName" Runat="server" />
<br>
<asp:TextBox id="txtFirstName" Runat="Server" />
<br>
<br>
<asp:Label id="lblLastName" Text="Last Name:" AssociatedControlID="txtLastName" Runat="server" />
<br>
<asp:TextBox id="txtLastName" Runat="server" />
</asp:WizardStep>
<asp:CreateUserWizardStep />
</WizardSteps>
</asp:CreateUserWizard>
</form>
</body>
</html>
The exact error with stack trace is below:
Invalid object name 'dbo.aspnet_SchemaVersions'.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:System.Data.SqlClient.SqlException: Invalid object name 'dbo.aspnet_SchemaVersions'.
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): Invalid object name 'dbo.aspnet_SchemaVersions'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857242 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734854 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135 System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +367 System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnection connection) +85 System.Web.Security.SqlMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +3612 System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305 System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105 System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453 System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149 System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Any help is much appreciated, and thanks in advance.
How do you create the aspnet_SchemaVersions Table? did you use the tool come with VS? if not you have to verify all the table names, column names are type correctly. sepcially make sure your table name is "aspnet_SchemaVersions" not "aspnet_SchemaVersion"
Hope this help
|||I figured out the problem, I had changed the ownership of the table and apparantly the createuserwizard control doesn't like you to do that, so that generic error was the result.|||I am sure this is the case when you are working on local server, on your own machine.
What if you have deployed working application to the ftp server say (godaddy), which has old version of SQL, SQL Server 2000?
I am facing this issue, the application works fine on local machine, but when it comes to godaddy, I have an error:
Invalid object name 'dbo.aspnet_SchemaVersions'.
How to set schema for godaddy or just modify application on local machine so that when uploaded it works on host server. Any views are welcomed.
Cheers
sql
No comments:
Post a Comment