Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 April 15th, 2006, 06:14 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with ms sql-server abd logging

Hi,

I use asp.net 2.0 with Visual web developer.
I wrote a page (test.aspx) with the servercontrol "loginview" and another with servercontrol "login".
I defined some users.
When i start 'test.aspx' within VWD, it's ok: i type username +pw and i'm logged.
When i start from the browser, doing http://10.0.0.60/aspnettest (local IP and name of IIS application), i see all the files (browsing allowed) but when i click on 'test.aspx', i get the error:

(more or less translated)
"Failure of the creation of a user instance sql server because of a failure of extraction of the access path to the data of the local application of the user. Check that the user has a local user profile on the computer.
Connection closed."

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.


What's going on? How to solve this?
Thanks for help.


 
Old April 16th, 2006, 08:20 AM
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,

Did you just create a simple website and nothing else?

What happens when you create a brand new (file based) website in VWD, add a page with a Login control and then hit F5?? Do you get the same results?

And do you have SQL Server 2005 Express Edition installed on your development machine?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old April 18th, 2006, 09:14 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thanks for replying...
I created an IIS-application with some sipmle aspx, master and vb files for training. Nothing special.
I installed the last VWD (unasked french edition, probably because the selected language is french) on my windows 2000 iis-server (english edition), inclusive Sql-server express.

I'm sure i understand what you mean with:
What happens when you create a brand new (file based) website in VWD, add a page with a Login control and then hit F5?? Do you get the same results?
Phil





 
Old April 19th, 2006, 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

What I meant was: create a brand new web site in Visual Web Developer and have it all the defaults.

So:

1. Start VWD
2. Choose File | New Web Site
3. Browse to a new location and then click OK
4. On Default.aspx, add a CreateUserWizard and a Logon control
5. Hit Ctrl+F5

Does it work? Can you sign up?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: LAX by Xzibit (Track 2 from the album: Weapons Of Mass Destruction) What's This?
 
Old April 21st, 2006, 05:06 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I did what you said. By the way, i thought VWD would automatically create a IIS-application, but i have to make the directory created by VWD manually an IIS-application (to avoid error from we.config).
Back to the point: (i tried with existing and not existing users)
starting from the browser, i get the same error;
starting from VWD (F5 or ctrl-F5), i get this:
Server Error in '/newwebsite' Application.
--------------------------------------------------------------------------------

An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is -2 and the SqlException message is: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
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.

SQLExpress database file auto-creation error:


The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:


If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.


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:


[SqlExecutionException: An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is -2 and the SqlException message is: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]
   System.Web.Management.SqlServices.ExecuteFile(Stri ng file, String server, String database, String dbFileName, SqlConnection connection, Boolean sessionState, Boolean isInstall, SessionStateType sessionStatetype) +860
   System.Web.Management.SqlServices.SetupApplication Services(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +776
   System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +46
   System.Web.DataAccess.SqlConnectionHelper.CreateMd fFile(String fullFileName, String dataDir, String connectionString) +681


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Phil


 
Old April 21st, 2006, 12:12 PM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again,

I tried later in the day with the new website i made earlier and now i get the same error as in my first message when starting with the browser and doing http://myserver/website1 but it works again when starting from VWD with F5 or ctrl-F5).

I don't understand ...
Thanks

 
Old April 23rd, 2006, 05:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

When you run the site through IIS, the site runs under an account called ASPNET or Network Service, depending on the version of your OS.

If you run the site directly from VWD, it doesn't use IIS but instead uses the built-in webserver. That webserver runs with *your* privileges, and not those of the ASPNET or Network Service account.

So, this sounds like a permission issue. You probably need to give the App_Data folder the necessary permissions. Take a look here:

http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=263

It's targeted at ASP.NET 1.x but the same principles apply to .NET 2.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Catherine by P.J. Harvey (Track 6 from the album: Is This Desire?) What's This?
 
Old April 23rd, 2006, 11:23 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Maybe some more information: IIS and VWD both run on my domain-server.
The directory option of the application is set to 'anonymous' "IUSR_myserver" and 'integrated windows authentification'.
The app_data directory is on a FAT32 disc, so i can't set any permission on it.
Even when i unchecked 'anonymous' and being domain-administrator, it fails.
Thanks


 
Old April 23rd, 2006, 11:30 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What is the name of your SQL Express installation?

And did you configure your own connection string in the web.config, or are you relying on the default one? (e.g. (local)\SqlExpress for the providers)

And are you saying the domain controller (server) has a local FAT disk, or is the database located on a different machine?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old April 24th, 2006, 09:31 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I reinstalled asp.net + VWD +sqlexpress 20005 on the NTFS disc. I use windows 2000 sp4. I also created a new application on the NTFS disc. So everything is on that disc.

In IIS, anonymous access is set and application protection is middle.

I ran a little aspx file to check the user used by asp.net: it's IWAM_myserver. So i put the permissions for the directory of the application to FULL CONTROL for IWAM_myserver (and also to IUSR_myserver to be sure).

I ran login.aspx again (as downloaded from Wrox site). The web.config contains only <connectionStrings /> (i didn't change anything).

From VWD; it still works; but from the browser, i get:
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

I changed web.config into this:
<add name="test"
        connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|aspnetdb.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient" />
  </connectionStrings>

but same error.

What can i do more???
Thanks for your time.







Similar Threads
Thread Thread Starter Forum Replies Last Post
How Run .sql Script file in MS SQL Server 2000? aarkaycee SQL Server 2000 5 October 12th, 2009 05:43 AM
MS SQL Server license dk6607 SQL Server 2005 1 February 7th, 2008 07:32 PM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
Logging in to SQL Server mark.roworth Access VBA 4 August 30th, 2004 01:39 PM
MS SQL Server Replication rodmcleay SQL Server 2000 2 August 12th, 2004 02:33 AM





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