Website Development Problems

W

Wayne Smith

Applies to: Visual Studio 2008 Professional

Hi everyone,
I'm in the middle of creating a website with VS2008 and I'm trying to integrate a user registration/login section on the website but I've come up against a small problem. I've configured the database and set up a test user through the ASP.NET Website Administration Tool (Website > ASP.NET Configuration), I've created a user registration page and a user login page but when I try to register a test user from the website itself, I'm receiving the following error message - yet I can add a new user without any problems from the Website Administration Tool - but that kind of defeats the point because I want users to be able to self-register through the website. The error message that I see when I test the registration page on the website is:

Failed to update the database because the database is read-only

which doesn't make much sense to me because I can register a new user through the website administration tool which must indicate the database has write permissions and if I drill down to the directory where the database is stored on the website and right-click > Properties, it doesn't have a tick in the box for read-only, so I'm a bit confused why I would be getting this error or what I can do to resolve it.

Can anyone offer any suggestions or workarounds please as I don't really know how to solve this problem

Many thanks in advance
Wayne
 
S

sloan

One possible issue:

You should always be aware of which account is running in development and production code.

Here is come crappy code to show you:

Run it in the "not working" scenario and give rights to that user.




private string FindIIdentity()

{


try


{


//'Dim user As WindowsPrincipal =
CType(System.Threading.Thread.CurrentPrincipal, WindowsPrincipal)


//'Dim ident As IIdentity = user.Identity


string returnValue = string.Empty;


WindowsIdentity ident = WindowsIdentity.GetCurrent();


returnValue = ident.Name;


try


{


returnValue += " on " + System.Environment.MachineName;



}


catch (Exception ex)

{



}


return returnValue;


}
Applies to: Visual Studio 2008 Professional

Hi everyone,
I'm in the middle of creating a website with VS2008 and I'm trying to integrate a user registration/login section on the website but I've come up against a small problem. I've configured the database and set up a test user through the ASP.NET Website Administration Tool (Website > ASP.NET Configuration), I've created a user registration page and a user login page but when I try to register a test user from the website itself, I'm receiving the following error message - yet I can add a new user without any problems from the Website Administration Tool - but that kind of defeats the point because I want users to be able to self-register through the website. The error message that I see when I test the registration page on the website is:

Failed to update the database because the database is read-only

which doesn't make much sense to me because I can register a new user through the website administration tool which must indicate the database has write permissions and if I drill down to the directory where the database is stored on the website and right-click > Properties, it doesn't have a tick in the box for read-only, so I'm a bit confused why I would be getting this error or what I can do to resolve it.

Can anyone offer any suggestions or workarounds please as I don't really know how to solve this problem

Many thanks in advance
Wayne
 
N

Norman Yuan

You did not say what database you use. I assume that you are very likely using SQL Server Express with ASP.NET membership provider. A common mistake made by most new ASP.NET developer is to jump up the development using SQL Server membership provider (ASP.NET default, and VS makes it so easy) without very basic knowledge/understanding of SQL Server (I can tell from your description, like "if I drill down to the directory where the database is stored on the website and right-click > Properties, it doesn't have a tick in the box for read-only...". You do not check/do anything to the database file, it is completely controlled by SQL Server. So you have to make sure your database server SQL Server Express) is set up correctly.

Sorry to say that, but IMO, it is vital to have basic SQL Server knowledge before using it as website membership tool.

Applies to: Visual Studio 2008 Professional

Hi everyone,
I'm in the middle of creating a website with VS2008 and I'm trying to integrate a user registration/login section on the website but I've come up against a small problem. I've configured the database and set up a test user through the ASP.NET Website Administration Tool (Website > ASP.NET Configuration), I've created a user registration page and a user login page but when I try to register a test user from the website itself, I'm receiving the following error message - yet I can add a new user without any problems from the Website Administration Tool - but that kind of defeats the point because I want users to be able to self-register through the website. The error message that I see when I test the registration page on the website is:

Failed to update the database because the database is read-only

which doesn't make much sense to me because I can register a new user through the website administration tool which must indicate the database has write permissions and if I drill down to the directory where the database is stored on the website and right-click > Properties, it doesn't have a tick in the box for read-only, so I'm a bit confused why I would be getting this error or what I can do to resolve it.

Can anyone offer any suggestions or workarounds please as I don't really know how to solve this problem

Many thanks in advance
Wayne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top