Re: Login fails. Login failed for user 'LAPTOP\ASPNET'
From: WJH (intLink_at_adelphia.net)
Date: 03/05/04
- Next message: Preet Kanwaljit Singh Shergill: "SQL search conditions"
- Previous message: Todd: "Newbie question, help! thanks"
- In reply to: James Goodman: "Re: Login fails. Login failed for user 'LAPTOP\ASPNET'"
- Next in thread: David Schleifer [MSFT]: "Re: Login fails. Login failed for user 'LAPTOP\ASPNET'"
- Reply: David Schleifer [MSFT]: "Re: Login fails. Login failed for user 'LAPTOP\ASPNET'"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Mar 2004 08:22:37 -0800
I don't care how I log on as long as I, and anyone else accessing the site,
can open the web page that includes the data from the database (I think that
requires anonymous access being enabled).
What I don't understand is how the 3 lines of code below can work when run
in Web Matrix, but not work when run in Visual Studio or accessed directly
by my browser. If I could figure that out, I could presumably fix the
problem.
Bear in mind also, that a number of possible causes of the problem can be
ruled out by the fact that the code works fine if I change 'certainteed' to
'store'.
What do you think?
"James Goodman" <james@norton-associates.REMOVE.co.uk> wrote in message
news:c29fip$j6l$1@hercules.btinternet.com...
> I am assuming you are not logging in to your computer as user 'ASPNET'.
>
> If you want to login as yourself to SQL Server, you need to set the
> properties for your website to only allow Windows Authentication. If
> Anonymous access is enabled, by default all users will attempt to login as
> user 'COMPUTER\ASPNET'.
>
> If you do want to login as user 'ASPNET', you will need to add the login
to
> the SQL server instance on your laptop.
>
>
> --
> James Goodman
> MCSE MCDBA
> http://www.angelfire.com/sports/f1pictures/
> "WJH" <intLink@adelphia.net> wrote in message
> news:yuCdnSxB7tE0NdrdRVn-sA@adelphia.com...
> > I'm trying to open a connection to a local SQLSERVER database (on my
> > computer named Laptop).
> >
> > The following code works in WebMatrix, but cut and pasted into Visual
> Studio
> > it doesn't work. In Visual Studio, I get an error message, "Cannot open
> > database requested in login 'certainteed'. Login fails. Login failed for
> > user 'LAPTOP\ASPNET'".
> >
> > string connectionString = "server=\'(local)\'; trusted_connection=true;
> > database=\'certainteed\'";
> > System.Data.IDbConnection dbConnection = new
> > System.Data.SqlClient.SqlConnection(connectionString);
> > IDbConnection.Open();
> >
> > If I change one word in the connection string, 'certainteed' to 'store',
> the
> > code works to open a connection to that database which is on a different
> > local web site.
> >
> > Can you reconcile these facts to see a possible solution, so that I
could
> > use Visual Studio to establish the connection to the certaineed
database?
> >
> > Thanks in advance
> >
> >
>
>
- Next message: Preet Kanwaljit Singh Shergill: "SQL search conditions"
- Previous message: Todd: "Newbie question, help! thanks"
- In reply to: James Goodman: "Re: Login fails. Login failed for user 'LAPTOP\ASPNET'"
- Next in thread: David Schleifer [MSFT]: "Re: Login fails. Login failed for user 'LAPTOP\ASPNET'"
- Reply: David Schleifer [MSFT]: "Re: Login fails. Login failed for user 'LAPTOP\ASPNET'"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|