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 February 7th, 2007, 04:51 PM
Authorized User
 
Join Date: Jan 2006
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!
 
Old February 7th, 2007, 04:59 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
Old February 7th, 2007, 05:31 PM
Authorized User
 
Join Date: Jan 2006
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?
 
Old February 7th, 2007, 05:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
Old February 7th, 2007, 06:07 PM
Authorized User
 
Join Date: Jan 2006
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.
 
Old February 7th, 2007, 07:17 PM
Authorized User
 
Join Date: Jan 2006
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah, your Quickdocs are very good, leading me through that "how to"...
 
Old February 7th, 2007, 11:29 PM
Authorized User
 
Join Date: Jan 2006
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?
 
Old February 8th, 2007, 12:06 AM
Authorized User
 
Join Date: Jan 2006
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"
       />
-->
 
Old February 8th, 2007, 05:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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.
 
Old February 8th, 2007, 07:51 PM
Authorized User
 
Join Date: Jan 2006
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!





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





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