Forum
 
ForumForumDiscussions and...Discussions and....Net framework ....Net framework ...HowTo: Get SQL Server Express working with IISHowTo: Get SQL Server Express working with IIS
Previous Previous
 
Next Next
New Post
 25/06/2008 14:51
 
 Modified By RichardHowells  on 23/01/2009 10:09:06

Having just had a load of pain I'm documenting what worked for me.

Environment - Windows Server 2003/Sql Server Express

  1. Created a brand new web site on the machine
  2. Installed SQL Server Express
  3. Copied website and database from another machine.  Website/database worked fine using the ASP.Net development server and VS 2008
  4. Could not get the site to show up in IE
  5. Event log reported "An attempt to attach an auto-named database for file ... A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."
  6. I never got to the root of this but I did two things.  I removed the User Instance=True from the connection string and I manually attached the database using SQL Server Management Studio.  After manually attaching it, it had a really strange name in SSMS, obviously based on the file name.  Copied and pasted that to the connection string as in "...Database=<strange name>... " removed the bit about AttachFile.
  7. Couldn't get the web site up, but at least there was an error message in IE.
  8. Back in SSME in the security folder I added a Login for the IIS account to the Security folder for SQL Server Express and again to the Security Folder for my database.  I'm not certain both are needed.  When adding to the database I ticked the roles datareader and datawriter.
  9. The site was starting to work now, but threw an exception because it could not get at stored procedures.
  10. I could not find a role that obviously mapped to "Let stored procedures run".  I gave the account db-owner rights.  I'm not very happy with that, but I am not sure what the best practice is in this area.
  11. I'd be really happy to get some feedback on this.  It seems incredibly tortuous and I'm not at all sure I have the best settings.

Cheers,
- Richard
If this post helped you over a problem, or taught you something new, please login and rate it. Ratings are in the drop down in the top left corner
Previous Previous
 
Next Next
ForumForumDiscussions and...Discussions and....Net framework ....Net framework ...HowTo: Get SQL Server Express working with IISHowTo: Get SQL Server Express working with IIS

Forum Usage Guidelines

The forums are a place for all to exchange ideas and techniques, and to post and answer questions.  All are welcome to read, registration is required to post. 

If you learn somthing new, discover or acquire a new technique, then please take a moment to register and rate the post that just helped you.  This site does not send spam and it does not release your personal details.  Full details in the site privacy policy.

We have some simple posting guidelines to keep the forums a pleasant and informative environment.

  • No flames, no trolls
  • No profanity, no racism
  • Site management has the final word on approving or removing any thread, post, or comment
  • English language only please

 

Copyright 2002-15 by Dynamisys Ltd