Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 February 7th, 2007, 04:51 PM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default [SqlException (0x80131904): Cannot open user defau

On my development machine, I published my site to an IIS virtual directory, updated my configuration strings, and it works fine.
Then I copied the site files my laptop, and update the configuration strings. When I get to my login page, using the ASP.NET login control, I get this:

[SqlException (0x80131904): Cannot open user default database. Login failed. Login failed for user 'D620\ASPNET'.]

I checked the application name issue...it seems to be ok. I triple checked the configuration strings, they seem to be ok. The ASPNETDB files are embedded in my custom DB; I can access them fine on the laptop using SSMSEE.

I see that there are many posts on this subject and don't see that there is a single solution, except related to permissions, which I don't know how to set.

Very important that I fix this soon; ready to burn one of my tickets with MS...any help would be appreciated.

Thanks!
Reply With Quote
  #2 (permalink)  
Old February 7th, 2007, 04:59 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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi wirerider,

Maybe this helps: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=395

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #3 (permalink)  
Old February 7th, 2007, 05:31 PM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I'll give that a close look in about 30 minutes.
I'm using SQL Express, windows authentication...should that make any difference in reading your article?
Reply With Quote
  #4 (permalink)  
Old February 7th, 2007, 05:40 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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Yes. With Express, you should just give proper permissions to the App_Data folder for the ASPNET account....

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #5 (permalink)  
Old February 7th, 2007, 06:07 PM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

>> Yes. With Express, you should just give proper permissions to the App_Data folder for the ASPNET account....

Thanks for the message. Unfortunately, I'm at an experience level where I can't parse that instruction. Don't know where to start from a button clicking point of view...any tips would be appreciated.
Reply With Quote
  #6 (permalink)  
Old February 7th, 2007, 07:17 PM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah, your Quickdocs are very good, leading me through that "how to"...
Reply With Quote
  #7 (permalink)  
Old February 7th, 2007, 11:29 PM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

However, not enough for my newbie starting point. Spent 3 hours with MS asp.net and sql server. Your stuff was part of the solution, danke, but finally we could only get it to work when we used a particular config string that required that we attached the DB's thru SSMSEE...could not get attachDBFile= to work...Any clues on why that might be?
Reply With Quote
  #8 (permalink)  
Old February 8th, 2007, 12:06 AM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

More specifically...
The first string below works fine on the development site, in the published site folder, with the proper file path. But it fails on the laptop, giving the error described above.

Using the second string below allows the app to work fine, provided that the DB is pre-attached using SSMSEE...which isn't particularly useful for a mid-night site visitor.

The MS guys tried dozens of variations of permissions and users, to get the first one to work...no joy yet.

So something about this is particular to attachdbfile...any pointers on that would be appreciated.

Thanks!



    <!--
    <add name="XYZConnectionString"
  connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\7000_DEMO\ yada_yada\App_Data\XYZ.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
  providerName="System.Data.SqlClient" />
-->


    <!--
    <add name="XYZConnectionString"
             connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=XYZ;Data Source=xxx\SQLEXPRESS"
       />
-->
Reply With Quote
  #9 (permalink)  
Old February 8th, 2007, 05:21 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: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, if the guys from Microsoft can't work it out while on the phone with you, I doubt that we can offer something substantial.... :-(

Have you tried the first connection string without the "User Instance=true" part?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #10 (permalink)  
Old February 8th, 2007, 07:51 PM
Authorized User
Points: 514, Level: 8
Points: 514, Level: 8 Points: 514, Level: 8 Points: 514, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar, you're too modest. The suggestion you provided did the trick. When we took out the User Instance = True, the config string worked. When we added a Login for the main Windows User, through SSMSEE, then putting the User Instance = True back in worked as well. This Login was not required on my development machine, so more mystery, though the development machine is SQL Express 9.0.1399, and the deployment box is 9.0.2047...BTW, MS handled the case most graciously.
Thanks!
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
Sqlexception monika.vasvani ASP.NET 2.0 Basics 0 June 12th, 2008 03:28 AM
[SqlException (0x80131904): Cannot open user defau wirerider BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 February 7th, 2007 04:53 PM
Cannot open user default database KamalRaturi ASP.NET 2.0 Professional 2 October 25th, 2006 10:43 AM
Can ASP open a DB on user machine? (not on server) cookster Classic ASP Databases 2 October 5th, 2005 10:08 AM
Why user download word file is binary when open Andraw Classic ASP Basics 5 January 17th, 2005 12:41 PM



All times are GMT -4. The time now is 09:37 AM.


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