Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 20th, 2006, 12:43 PM
Authorized User
 
Join Date: May 2006
Location: , , Singapore.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Appointment Booking problem

Hi,

Whenever I tried to signup a new user, I keep getting the following message:

Failed to update database "C:\INETPUB\WWWROOT\APPOINTMENTBOOKING\APP_DATA\AS PNETDB.MDF" because the database is read-only.
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: Failed to update database "C:\INETPUB\WWWROOT\APPOINTMENTBOOKING\APP_DATA\AS PNETDB.MDF" because the database is read-only.

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.

I have set read and Write premission in IIS and have run out of ideas how to make this work.

Any help would be appreciated.



  #2 (permalink)  
Old May 21st, 2006, 03:44 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Did you check the App_Data folder and the database? Make sure both the App_Data folder and the .MDF and .LDF files inside that folder are not read-only, and that the account used by the webserver (can be you, or ASPNET or Network Service) has sufficient permissions to write to the database.

Please let me know if you need help configuring these folders. If you do, can you describe your setup in a bit more detail (e.g. what OS you're using, whether you used the application's Installer or opened the source directly etc etc)

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old May 21st, 2006, 05:51 AM
Authorized User
 
Join Date: May 2006
Location: , , Singapore.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using Windows XP Professional.
The computer is not joined to domain and still in workgroup.
Hence the folder security options is limited to only Hidden and Read-Only attributes, both of which are unchecked.

I have configure IIS 5.1 to use path [u]c:\inetpub\wwwroot\AppointmentBooking\</u> as Virtual Directory.

I gave [u]Read</u>, [u]Write</u>, [u]Log Vis</u>its and [u]Index this resource</u> rights to it.

Executive permissions are set to "Scripts only"

I have tried installing the AppointmentBooking module using the installer on both the CD and the source from Wrox Website.

Both of them gave me the same results.

Hope this information helps.

  #4 (permalink)  
Old May 21st, 2006, 06:27 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
quote:Hence the folder security options is limited to only Hidden and Read-Only attributes
This is not completely true. Check out this FAQ:

http://Imar.Spaanjaars.Com/QuickDocId.aspx?QUICKDOC=286

Once you followed the steps mentioned in the FAQ, you do get the Security tab on the folder's Properties dialog. You can then set the required permissions for the ASPNET account.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #5 (permalink)  
Old May 21st, 2006, 10:43 AM
Authorized User
 
Join Date: May 2006
Location: , , Singapore.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!!
That solved the problem.

However another pops up.

Server Error in '/AppointmentBooking' Application.
--------------------------------------------------------------------------------

An existing connection was forcibly closed by the remote host
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.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

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:


[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
   System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +1017835
   System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +119

[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
   System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +267
   System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32 count) +41
   System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) +96
   System.Net.Mail.SmtpReplyReaderFactory.ReadLines(S mtpReplyReader caller, Boolean oneLine) +280
   System.Net.Mail.SmtpReplyReaderFactory.ReadLine(Sm tpReplyReader caller) +26
   System.Net.Mail.SmtpReplyReader.ReadLine() +13
   System.Net.Mail.SmtpConnection.GetConnection(Strin g host, Int32 port) +802
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316
   System.Net.Mail.SmtpClient.GetConnection() +42
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1485

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +2074
   System.Web.UI.WebControls.LoginUtil.SendPasswordMa il(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +341
   System.Web.UI.WebControls.CreateUserWizard.Attempt CreateUser() +571
   System.Web.UI.WebControls.CreateUserWizard.OnNextB uttonClick(WizardNavigationEventArgs e) +105
   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Obj ect source, EventArgs e) +453
   System.Web.UI.WebControls.CreateUserWizard.OnBubbl eEvent(Object source, EventArgs e) +149
   System.Web.UI.WebControls.WizardChildTable.OnBubbl eEvent(Object source, EventArgs args) +17
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
   System.Web.UI.WebControls.Button.OnCommand(Command EventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +163
   System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




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

  #6 (permalink)  
Old May 21st, 2006, 11:01 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi again,

This sounds like a problem with sending mail from within the application. Did you change the <system.net> node of the web.config file so the <network> node contains a valid SMTP host?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #7 (permalink)  
Old May 21st, 2006, 11:22 AM
Authorized User
 
Join Date: May 2006
Location: , , Singapore.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wow! You are right!Excellent!
Hit it right at the spot.
I am running this application on my local computer, so if SMTP needs to be configured, I am lost.

I have look thru the chapter but nothing was mentioned on this. (I could have missed it)

Any chance I can be directed to set this?

Or do I need have a real SMTP server to do this?

  #8 (permalink)  
Old May 21st, 2006, 11:35 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're right. It's not mentioned explicitly in that chapter. However, a few references to chapter 6 are made (in the section that discusses the web.config and global.asax files) where this is explained in more detail.

You can configure the app to use your ISP's smtp server, so there's no need to have an SMTP server locally. Just copy the smtp name from your e-mail program into the web.config file and you should be good to go...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #9 (permalink)  
Old May 21st, 2006, 12:10 PM
Authorized User
 
Join Date: May 2006
Location: , , Singapore.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks! everything works now!
This has been a fruitful experience for me!

Thanks for your quick response!

  #10 (permalink)  
Old May 21st, 2006, 12:52 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're welcome.

Can I ask what you are using the Appointment Booking System for? Are you just looking at the source to learn from it, or are you using it as the basis for a real word application? In the latter case, does the application meet most of your requirements, or are there important features missing?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 


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
Appointment Booking KDSTECH BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 11 May 29th, 2008 12:46 AM
Appointment booking philblack1 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 January 25th, 2008 01:17 PM
Appointment Booking System newbie07 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 July 18th, 2007 08:32 AM
Modifications to Appointment Booking... mkumar BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 March 31st, 2007 01:51 AM
Appointment Booking Problem richardson167 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 February 26th, 2007 07:00 AM



All times are GMT -4. The time now is 04:02 PM.


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