I've been using WebMatrix and a StarterSite with the basic for authentication. I completed my application and it's been working very well on WebMatrix. No problem with _AppStart to access my database (kalf.sdf). However, when I hooked everything upon the internet
via my hosting provider, I ran into a database access problem. All the pages where I have code related to access the database are not working.
Though, when I disable this line of code:
- WebSecurity.InitializeDatabaseConnection
from the _AppStart and all lines of code in any other pages that use the database, the website can only run pages that do not access the database.
How could I possible solve that problem? Can someone, please, help me figure out a solution?
If you can only run pages that don't access db 2 things come to mind:
- you need to upload all the dlls to bin folder like System.Data.SQLServerCe.dll, etc. - did you do that ? if not please read this article it explains how to publish your site
Yes, I did upload all the bin folder because I used WebMatrix for the publishing. It may be in fact a permission problem. Should that permission be in the Web.config despite the fact I used the embedded form (.sdf) which does not need connection links? Shouldn't
the permissions be granted by the provider?
Don't know who is your host, but most allow do that from control panel. Login and make sure there is write/read permission (for NETWORK SERVICE) set for app_data folder.
BTW do you see any errors - is yes post the error it could be a big help
hjp810
Member
25 Points
20 Posts
_AppStart and StarterSite
Mar 01, 2012 12:27 AM|LINK
Hi,
I've been using WebMatrix and a StarterSite with the basic for authentication. I completed my application and it's been working very well on WebMatrix. No problem with _AppStart to access my database (kalf.sdf). However, when I hooked everything upon the internet via my hosting provider, I ran into a database access problem. All the pages where I have code related to access the database are not working.
Though, when I disable this line of code:
- WebSecurity.InitializeDatabaseConnection
from the _AppStart and all lines of code in any other pages that use the database, the website can only run pages that do not access the database.
How could I possible solve that problem? Can someone, please, help me figure out a solution?
Best regards
TOMCIO
Contributor
3648 Points
833 Posts
Re: _AppStart and StarterSite
Mar 01, 2012 01:23 AM|LINK
If you can only run pages that don't access db 2 things come to mind:
- you need to upload all the dlls to bin folder like System.Data.SQLServerCe.dll, etc. - did you do that ? if not please read this article it explains how to publish your site
http://www.microsoft.com/web/post/how-to-publish-a-web-application-using-webmatrix
- may be a problem with permissions - make sure that app_data folder has read/write permissions
Web: Chicago Website Design
r@zorC - Open Source ASP.net CMS for WebMatrix
hjp810
Member
25 Points
20 Posts
Re: _AppStart and StarterSite
Mar 01, 2012 02:08 AM|LINK
Thank you for your answer,
Yes, I did upload all the bin folder because I used WebMatrix for the publishing. It may be in fact a permission problem. Should that permission be in the Web.config despite the fact I used the embedded form (.sdf) which does not need connection links? Shouldn't the permissions be granted by the provider?
Thank you again.
TOMCIO
Contributor
3648 Points
833 Posts
Re: _AppStart and StarterSite
Mar 01, 2012 02:39 AM|LINK
Don't know who is your host, but most allow do that from control panel. Login and make sure there is write/read permission (for NETWORK SERVICE) set for app_data folder.
BTW do you see any errors - is yes post the error it could be a big help
Web: Chicago Website Design
r@zorC - Open Source ASP.net CMS for WebMatrix
hjp810
Member
25 Points
20 Posts
Re: _AppStart and StarterSite
Mar 01, 2012 01:55 PM|LINK
Thanks a lot for your help. I'm trying to work it out with my provider (STP Hosting) and will let you know if everything has been solved.
By the way, When I tried to create an account, it took the macine almost two hors before throwing this message error:
Service Unavailable
HTTP Error 503. The service is unavailable.
after some of the steps have been cleared.
Thanks a lot
hjp810
Member
25 Points
20 Posts
Re: _AppStart and StarterSite
Mar 02, 2012 03:29 AM|LINK
Hi,
Despite all, I'm running into the same problem of not being able to access the database. However, now I have a different type of error message:
Please correct the errors and try again.
The Provider encountered an unknown error.
And I try to log in using the services (OAuth) openId, it got frozen. Again the access to the database was denied.
What could that be?
Regards