September 2, 2010

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

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: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Stack Trace:






[SqlException (0x80131904): Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844747
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +378
   System.Web.Security.SqlRoleProvider.CheckSchemaVersion(SqlConnection connection) +69
   System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +478
   System.Web.Security.Roles.RoleExists(String roleName) +73
   ASP.global_asax.Application_Start(Object sender, EventArgs e) in D:\TanviDoc\ASP.NET Classifieds\ClassifiedsExtended\websell\global.asax:8




The 'Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'  to be caused by the fact that the stored procedures in the aspnetdb.mdf explicitly reference 'dbo' (as the database owner).
Run the Below Script under ASPNETDB in SQLQueryAnalyzer to change the database owner to 'dbo'.
sp_changeobjectowner  aspnet_Applications,dbo
GO
sp_changeobjectowner  aspnet_Membership,dbo
GO
sp_changeobjectowner  aspnet_Paths,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAllUsers,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationPerUser,dbo
GO
sp_changeobjectowner  aspnet_Profile,dbo
GO
sp_changeobjectowner  aspnet_Roles,dbo
GO
sp_changeobjectowner  aspnet_SchemaVersions,dbo
GO
sp_changeobjectowner  aspnet_Users,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles,dbo
GO
sp_changeobjectowner  aspnet_WebEvent_Events,dbo
GO
sp_changeobjectowner  aspnet_AnyDataInTables,dbo
GO
sp_changeobjectowner  aspnet_Applications_CreateApplication,dbo
GO
sp_changeobjectowner  aspnet_CheckSchemaVersion,dbo
GO
sp_changeobjectowner  aspnet_Membership_ChangePasswordQuestionAndAnswer,dbo
GO
sp_changeobjectowner  aspnet_Membership_CreateUser,dbo
GO
sp_changeobjectowner  aspnet_Membership_FindUsersByEmail,dbo
GO
sp_changeobjectowner  aspnet_Membership_FindUsersByName,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetAllUsers,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetNumberOfUsersOnline,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetPassword,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetPasswordWithFormat,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetUserByEmail,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetUserByName,dbo
GO
sp_changeobjectowner  aspnet_Membership_GetUserByUserId,dbo
GO
sp_changeobjectowner  aspnet_Membership_ResetPassword,dbo
GO
sp_changeobjectowner  aspnet_Membership_SetPassword,dbo
GO
sp_changeobjectowner  aspnet_Membership_UnlockUser,dbo
GO
sp_changeobjectowner  aspnet_Membership_UpdateUser,dbo
GO
sp_changeobjectowner  aspnet_Membership_UpdateUserInfo,dbo
GO
sp_changeobjectowner  aspnet_Paths_CreatePath,dbo
GO
sp_changeobjectowner  aspnet_Personalization_GetApplicationId,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAdministration_DeleteAllState,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAdministration_FindState,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAdministration_GetCountOfState,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAdministration_ResetSharedState,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAdministration_ResetUserState,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAllUsers_GetPageSettings,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAllUsers_ResetPageSettings,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationAllUsers_SetPageSettings,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationPerUser_GetPageSettings,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationPerUser_ResetPageSettings,dbo
GO
sp_changeobjectowner  aspnet_PersonalizationPerUser_SetPageSettings,dbo
GO
sp_changeobjectowner  aspnet_Profile_DeleteInactiveProfiles,dbo
GO
sp_changeobjectowner  aspnet_Profile_DeleteProfiles,dbo
GO
sp_changeobjectowner  aspnet_Profile_GetNumberOfInactiveProfiles,dbo
GO
sp_changeobjectowner  aspnet_Profile_GetProfiles,dbo
GO
sp_changeobjectowner  aspnet_Profile_GetProperties,dbo
GO
sp_changeobjectowner  aspnet_Profile_SetProperties,dbo
GO
sp_changeobjectowner  aspnet_RegisterSchemaVersion,dbo
GO
sp_changeobjectowner  aspnet_Roles_CreateRole,dbo
GO
sp_changeobjectowner  aspnet_Roles_DeleteRole,dbo
GO
sp_changeobjectowner  aspnet_Roles_GetAllRoles,dbo
GO
sp_changeobjectowner  aspnet_Roles_RoleExists,dbo
GO
sp_changeobjectowner  aspnet_Setup_RemoveAllRoleMembers,dbo
GO
sp_changeobjectowner  aspnet_Setup_RestorePermissions,dbo
GO
sp_changeobjectowner  aspnet_UnRegisterSchemaVersion,dbo
GO
sp_changeobjectowner  aspnet_Users_CreateUser,dbo
GO
sp_changeobjectowner  aspnet_Users_DeleteUser,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles_AddUsersToRoles,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles_FindUsersInRole,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles_GetRolesForUser,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles_GetUsersInRoles,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles_IsUserInRole,dbo
GO
sp_changeobjectowner  aspnet_UsersInRoles_RemoveUsersFromRoles,dbo
GO
sp_changeobjectowner  aspnet_WebEvent_LogEvent,dbo
GO
sp_changeobjectowner  vw_aspnet_WebPartState_User,dbo
GO
sp_changeobjectowner  vw_aspnet_Applications,dbo
GO
sp_changeobjectowner  vw_aspnet_MembershipUsers,dbo
GO
sp_changeobjectowner  vw_aspnet_Profiles,dbo
GO
sp_changeobjectowner  vw_aspnet_Roles,dbo
GO
sp_changeobjectowner  vw_aspnet_Users,dbo
GO
sp_changeobjectowner  vw_aspnet_UsersInRoles,dbo
GO
sp_changeobjectowner  vw_aspnet_WebPartState_Paths,dbo
GO
sp_changeobjectowner  vw_aspnet_WebPartState_Shared,dbo
GO

No comments:

Post a Comment