Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 23rd, 2008, 04:27 PM
Authorized User
 
Join Date: Oct 2008
Location: , , .
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default chapter 15 -create user account

Hi,

I am following tutorial on Imar's book, everything was great until chapter 15. When I tried to create the login+create user account, it failed to create the instant of SQL DB under the App_Data folder. I follow the sugestion on the error page(show below):

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be 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.

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:

1. 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.

2. 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.

3. Sql Server Express must be installed on the machine.
4. 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.



FYI: The App_Data folder properties show "Read ONLY" (my os XP Professional service pack 2, I installed SQL 2005 + Management studio after I installed VWD 2008 express), I can't see the "Security" tab.
Then my administrator set the whole folder (root folder) that I write into it, but the weird thing is the property still show "Read Only" and I still got the same error.

Any idea what might wrong?

Thanks you for your help


Reply With Quote
  #2 (permalink)  
Old October 24th, 2008, 07:46 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

The read-only check box shouldn't be there. However, XP has an issue where it shows a dimmed checkbox even though the underlying files and folders aren't read-only.

My guess is that it's not related to the read-only flag (although you could try turning it off), but related to security. You should have the security tab in order to set the permissions. Take a look at Step 3 on page 654 to see how to enable the security tab. The pages that follow explain how to configure the App_Data folder.

If you can't control this folder yourself, have your admin look at chapter 18 so he can configure the permissions correctly.

Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #3 (permalink)  
Old October 24th, 2008, 11:26 AM
Authorized User
 
Join Date: Oct 2008
Location: , , .
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you so much for your quick reply Imar.

I still can not see the Security tab, even though, like you pointd out on Step 3 on page 654, the "Use Simple file sharing(Recomended) is not checked.

Anyway, I was able to make it work by connecting directly to the database, not attached the ASPNETDB into App_Data folder.

Thanks again, it's a great book for beginner like myself:)

Reply With Quote
  #4 (permalink)  
Old October 24th, 2008, 01:32 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Strange; it shouldn't be like that. Anyway, glad it's working and good to hear you like the book so much.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #5 (permalink)  
Old November 26th, 2008, 01:52 PM
Authorized User
 
Join Date: Oct 2008
Location: , , .
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Imar,
Related to this question, in my pruduction server, I will be allowed only 1 databse. My development version at the moment, I have 2 database, "MyAppDatabase" and "ASPNETDB".
My question is how can I configure so all the tables inside ASPNETDB will be created inside MyAppDatabse.

The "ConnectionString" on my web.config, look something like this:

<connectionStrings>
      <clear/>
        <add name="DBConnection" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=MyAppDatabase;User Id=TEST; password=TEST" providerName="System.Data.SqlClient"/>
     <add name="LocalSqlServer" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=ASPNETDB;User Id=TEST; password=TEST" providerName="System.Data.SqlClient" />
    </connectionStrings>

I know I have to change thiis ConnectionStrings, I just don't know what to be changed.

Thanks Imar:)

Melania

Reply With Quote
  #6 (permalink)  
Old November 26th, 2008, 02:21 PM
Authorized User
 
Join Date: Oct 2008
Location: , , .
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Imar,

I tried changed my web.config (membership|providers : "connectionStringName" to use "MyAppDatabase")

  <membership>
            <providers>
                <clear/>
                <add name="AspNetSqlMembershipProvider"
                   type="System.Web.Security.SqlMembershipProvider,
                   System.Web, Version=2.0.0.0,
                   Culture=neutral,
                   PublicKeyToken=b03f5f7f11d50a3a"
                   connectionStringName="DBConnection"
                   enablePasswordRetrieval="false"
                   enablePasswordReset="true"
                   requiresQuestionAndAnswer="false"
                   applicationName="/"
                   requiresUniqueEmail="false"
                   passwordFormat="Hashed"
                   maxInvalidPasswordAttempts="5"
                   minRequiredPasswordLength="6"
                   minRequiredNonalphanumericCharacters="1"
                   passwordAttemptWindow="10"
                   passwordStrengthRegularExpression=""/>
            </providers>
        </membership>

But I got the following error:
Server Error in '/DemoSite' 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.Security.SqlMembershipProvider.CheckSch emaVersion(SqlConnection connection) +89
   System.Web.Security.SqlMembershipProvider.CreateUs er(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) +2430
   System.Web.UI.WebControls.CreateUserWizard.Attempt CreateUser() +318
   System.Web.UI.WebControls.CreateUserWizard.OnNextB uttonClick(WizardNavigationEventArgs e) +102
   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Obj ect source, EventArgs e) +418
   System.Web.UI.WebControls.CreateUserWizard.OnBubbl eEvent(Object source, EventArgs e) +161
   System.Web.UI.WebControls.WizardChildTable.OnBubbl eEvent(Object source, EventArgs args) +19
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


NOTES: I am using MS SQL 2005 EXPRESS edition NOT MS SQL 2005 full version. I will use MS SQL 2005 or MS SQL 2008 in production server

Thanks,

Melania

Reply With Quote
  #7 (permalink)  
Old November 26th, 2008, 02:49 PM
Authorized User
 
Join Date: Oct 2008
Location: , , .
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Imar, I was able to make it work on my local server by following the configuration steps from ScottGu's blog:
http://weblogs.asp.net/scottgu/archi...25/423703.aspx

However, I won't be able to go through this configuration in production server, since I am not managing it and does not only hosting my web site but also some other peoples sites.

What should I do?

Thanks again,

Melania

Reply With Quote
  #8 (permalink)  
Old November 26th, 2008, 05:23 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Depending on your setup and access, your host may need to do this for you. If you have access to the SQL Server, you may be able to use the Database Publishing Wizard as described in chapter 18 and update the database on the remote server with data from your local machine.

Hope this helps,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #9 (permalink)  
Old November 27th, 2008, 03:40 PM
Authorized User
 
Join Date: Oct 2008
Location: , , .
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks Imar:)

Melania

Reply With Quote
  #10 (permalink)  
Old December 3rd, 2008, 06:05 PM
Registered User
 
Join Date: Dec 2008
Location: , MI, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I am following the "Try-It-Out" on your "BEGINNING ASP.NET 3.5 In C# and VB" book. However in CH.15 (Page.520 Try-It-Out) I got struck as I tried using the LogIn control with the CreateUserWizard control. I am getting the following error while creating a new user.. Please help me in fixing this issue.

Server Error in '/Login' Application.
Login failed for user 'AKASMIKA-PC\AKASMIKA'.
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:

   1. 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.
   2. 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.
   3. Sql Server Express must be installed on the machine.
   4. 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:

[SqlException (0x80131904): Login failed for user 'AKASMIKA-PC\AKASMIKA'.]
   System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +800131
   System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +186
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
   System.Data.SqlClient.SqlInternalConnectionTds.Com pleteLogin(Boolean enlistOK) +33
   System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172
   System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
   System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
   System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
   System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
   System.Data.ProviderBase.DbConnectionFactory.Creat eNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
   System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +47
   System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Web.Management.SqlServices.GetSqlConnection (String server, String user, String password, Boolean trusted, String connectionString) +68

[HttpException (0x80004005): Unable to connect to SQL Server database.]
   System.Web.Management.SqlServices.GetSqlConnection (String server, String user, String password, Boolean trusted, String connectionString) +124
   System.Web.Management.SqlServices.SetupApplication Services(String server, String user, String password, Boolean trusted, String connectionString, String database, String dbFileName, SqlFeatures features, Boolean install) +86
   System.Web.Management.SqlServices.Install(String database, String dbFileName, String connectionString) +25
   System.Web.DataAccess.SqlConnectionHelper.CreateMd fFile(String fullFileName, String dataDir, String connectionString) +397


Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434


Thanks
Disha:(

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TO retrieive all user account name vinothsiva General .NET 1 June 15th, 2007 05:29 PM
How to creat an user account prad_a PHP Databases 1 May 12th, 2007 03:25 AM
Inactivate User Account NinaWilliam ASP.NET 1.0 and 1.1 Basics 5 March 13th, 2006 10:13 AM
Create User Account casselj ASP.NET 1.0 and 1.1 Professional 1 June 20th, 2005 08:34 AM
MSDE, how create database, user account ??? majidnakit All Other Wrox Books 1 January 7th, 2005 03:12 AM



All times are GMT -4. The time now is 11:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.