Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 29th, 2008, 03:42 AM
Registered User
 
Join Date: Dec 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Hi all,

I have a .net 2.0 website that is running on a shared hosting environment. In this database I don't have administrative permission and can't run the tool C:\WINDOWS\Microsoft.NET\Framework\<versionNumber> \aspnet_regsql.exe due to database remote connection restrictions. I am getting the following error, which I have been searching is due to (within a shared environment) not having the database owner name included (instead of 'dbo') within all calls from the provider classes. For what I can see, the 'dbo' prefix is hard coded in build-in SqlMembershipProvider/SqlRoleProvider.

Someone with the same problem can give me some advice?? Otherwise, I'm afraid I have to write a custom membership/role provider.

Thanks in advance,

Dominik.

-----------------------------------------------------------------------------------------

Server Error in '/' Application.
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'.

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(SqlExc eption exception, Boolean breakConnection) +1948826
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +4844747
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlCommand.FinishExecuteRead er(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(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.InternalExecuteNo nQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
System.Web.Util.SecUtility.CheckSchemaVersion(Prov iderBase provider, SqlConnection connection, String[] features, String version, Int32& schemaVersionCheck) +378
System.Web.UI.WebControls.WebParts.SqlPersonalizat ionProvider.CheckSchemaVersion(SqlConnection connection) +69
System.Web.UI.WebControls.WebParts.SqlPersonalizat ionProvider.LoadPersonalizationBlobs(WebPartManage r webPartManager, String path, String userName, Byte[]& sharedDataBlob, Byte[]& userDataBlob) +204
System.Web.UI.WebControls.WebParts.Personalization Provider.LoadPersonalizationState(WebPartManager webPartManager, Boolean ignoreCurrentUser) +94
System.Web.UI.WebControls.WebParts.WebPartPersonal ization.Load() +103
System.Web.UI.WebControls.WebParts.WebPartPersonal ization.LoadInternal() +23
System.Web.UI.WebControls.WebParts.WebPartManager. OnInit(EventArgs e) +293
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
 
Old December 29th, 2008, 05:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You could use the "Database Publishing Wizard" to script your local database with all its tables, views, procedures and data to a SQL file which you can run against your target database (or ask your host to run it for you).

For more infO: http://weblogs.asp.net/scottgu/archi...nt-part-1.aspx

Then they can grant the Network Service or other appropriate account the necessary rights to use these objects.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 30th, 2008, 07:23 AM
Registered User
 
Join Date: Dec 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar,


but I have published my website on SQL Server 2005 with all the data tables required for Membership. My problem is due by the fact that my database owner in not 'dbo' which is who ASP.NET provider calls hard coded as prefix. I don't have administrative permission, so I must deal between my hosting restrictions and the Microsoft hard coded implementation solutions.


Any suggestion??


Thanks in advance,


Dominik.
 
Old December 30th, 2008, 01:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You shouldn't have to be the owner of the objects in order to use them. Here's what I did to successfully use Membership with a low privileged account:

1. Create a local database in App_Data and added a few accounts with the CreateUserWizard

2. Used the Database Publishing Wizard to create a SQL file

3. Ran that file on the target server (with an account that has the proper permissions)

4. Created an account and gave it access to the aspnet_Membership_FullAccess account

5. Gave the account execute permissions by creating a role
/* CREATE A NEW ROLE */
CREATE ROLE db_executor

/* GRANT EXECUTE TO THE ROLE */
GRANT EXECUTE TO db_executor

6. Granted the user access to this new role.

The ASP.NET web site now has access to the tables, views and stored procedures defined in the database.

Item 4 through 6 need to be done by an account with proper permissions (typically your dba).

I don't know if, and how, you can do this with a modified script that allows you to create the necessary database objects yourself. Is it an option your DBA carries out these steps for you?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 30th, 2008, 05:34 PM
Registered User
 
Join Date: Dec 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar.

I tried these steps you tell me, but obiously I don't have the required permissions. I'm opening a ticket to ask my hosting for some solution and I hope my dba can run these script for me. Otherwise, I'll must overwrite custom membership/profile/role providers.

Anyway, my procedure is named something like 'dboxxx.aspnet_CheckSchemaVersion'. In this case, will the solution given in these steps works ok?? taking into account that .NET providers calls only procedures named as 'dbo'.

Thanks again,

Dominik.

Last edited by Dominik; December 30th, 2008 at 05:37 PM..
 
Old December 31st, 2008, 08:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, it should work. In my steps, I used the dbo for the objects, and then I was able to use them with a low privileged - non-dbo - account...

Hopefully your host can fix it; they should be able to successfully run your scripts or least prepare the database.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 8th, 2009, 05:09 PM
Registered User
 
Join Date: Dec 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again,

Unfortunatelly, it seems my hosting at aruba.it doesn't want to run these steeps for me, so I still have the same problem...

I' think my only solution would be to overwrite all the providers (so hard) or to find a better hosting.

Have someone any other solution?

Thanks,

Dominik.

Last edited by Dominik; January 8th, 2009 at 05:20 PM..
 
Old January 10th, 2009, 05:22 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> or to find a better hosting.

That sounds like the way to go...Typically, a host gives you full access to your database so you can do this yourself, or they should run these kind of scripts for you. If they don't offer both, you're pretty limited in what you can do.

It feels odd to rewrite the existing provider model (although it isn't that hard: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=404) just to bypass their limitations....

Just my 2 cents....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. Dominik BOOK: ASP.NET Website Programming Problem-Design-Solution 2 January 8th, 2009 05:17 PM
valid dbo; permission to impersonate dbo est BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 5 February 21st, 2007 04:44 AM
Could Not find stored Procedure kavyach BOOK: ASP.NET Website Programming Problem-Design-Solution 1 June 10th, 2005 06:53 AM
Could not find stored procedure ianmc BOOK: ASP.NET Website Programming Problem-Design-Solution 16 August 20th, 2004 03:40 PM
Could not find stored procedure 'sp_Polls_GetCurre jblp BOOK: ASP.NET Website Programming Problem-Design-Solution 1 September 18th, 2003 06:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.