Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / Connectivity / January 2006

Tip: Looking for answers? Try searching our database.

login failed for user error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bruce  lawson - 23 Jan 2006 03:17 GMT
Hi, I'm fairly new at SQL access from an ASPNET webform and cannot seem to
get the SqlConnection string to work properly.
I'm running VStudio, C#, IIS 5.1, MSDE sqlserver, Net 1.1 framework. The
connection code that causes the error is:
SqlConnection conn = new SqlConnection("Data Source=MYSERVER;Integrated
Security=SSPI;Initial Catalog=banking2002SQL");
SqlCommand cmd = new SqlCommand("Select * FROM tblEmployees", conn);
and upon compiling ok then running I get the error:
System.Data.SqlClient.SqlException: Login failed for user 'MYSERVER\ASPNET'.
I can successfully connect using either the Server Explorer using server
name: MYSERVER and using Windows NT Integrated Security and also using a
Query Analyzer tool called Query Express, so I assume there's a problem with
the ASPNET account or the anonymous account. I've set up IIS for anonymous
or not, to no avail. The web.config <authentication mode = "Windows"/>
The AspNet user is on the same local machine as the database. Any help is
sincerely appreciated.
Bruce L
Roger Wolter[MSFT] - 23 Jan 2006 06:14 GMT
When you connect from ASP..Net you are probably connecting as the ASPUSER
Windows user - unless you are doing some unique security code in the ASP
page.  Chances are you don't have a user and login defined for ASPUSER.
It's been a while since I used SQL 2000 but I think the procedures you will
need are sp_addlogin and sp_adduser.  You will have to grant the appropriate
permissions to the ASPUSER in your database also.

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Hi, I'm fairly new at SQL access from an ASPNET webform and cannot seem to
> get the SqlConnection string to work properly.
[quoted text clipped - 15 lines]
> sincerely appreciated.
> Bruce L
bruce  lawson - 25 Jan 2006 16:08 GMT
Hi, Thank you for your reply. I sent an email but it may not have gone thru,
as I'm on a work computer without a newsgroup server (aol). Anyway, I
appreciate your answer, but now think I have much bigger problems; I've been
getting memory errors, unexpected crashes and cannot connect to server
errors, which are becoming insistent, so I think it very well is a hardware
problem. Thanks again.
Bruce

> When you connect from ASP..Net you are probably connecting as the ASPUSER
> Windows user - unless you are doing some unique security code in the ASP
[quoted text clipped - 22 lines]
>> sincerely appreciated.
>> Bruce L
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.