Groups | Blog | Home
all groups > sql server connect > september 2003 >

sql server connect : Login Failed when connecto to asp.net with SQL server


Lisa
9/5/2003 3:06:49 PM
Hi:

I am working on the walkthrough samples for Visual C# and
I run into trouble with Walkthrough: Creating Read-Only
Data Access in a Web Forms Page. The error message I have
is:

Server Error in '/ReadOnlyDataAccess' Application.
-----------------------------------------------------------
---------------------

Login failed for user 'TESW265\ASPNET'.
Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Login
failed for user 'TESW265\ASPNET'.

Source Error:


Line 26: if (!IsPostBack)
Line 27: {
Line 28:
oleDbConnection1.Open();
Line 29:
System.Data.OleDb.OleDbDataReader Reader;
Line 30: Reader =
oleDbCommand1.ExecuteReader();


Source File:
c:\inetpub\wwwroot\readonlydataaccess\webform1.aspx.cs
Line: 28

Stack Trace:


[OleDbException (0x80040e4d): Login failed for
user 'TESW265\ASPNET'.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32
hr)
System.Data.OleDb.OleDbConnection.InitializeProvider()
System.Data.OleDb.OleDbConnection.Open()
ReadOnlyDataAccess.WebForm1.Page_Load(Object sender,
EventArgs e) in
c:\inetpub\wwwroot\readonlydataaccess\webform1.aspx.cs:28
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731




-----------------------------------------------------------
---------------------
Version Information: Microsoft .NET Framework
Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

I am working on a computer with windows xp profession and
I have IIS5.0 and SQL server 2000 install on my computer.
When I was setting OleDbConnection on the form, I test the
connection, which is working fine. When I test the
application at the end, I got the above error.

Please give me some advice to solve this problme.

Thanks a lot.

Jens Süßmeyer
9/7/2003 1:44:41 AM
When you use a trusted connection, you have to use impersonation with your
client, search for impersonation and asp.net on google, you will find plenty
of information out there. (You have to change the section in the web.config,
because standard is that the Account that you put in at the web server will
try to log in to sql server)

HTH, Jens Süßmeyer.



"Lisa" <lisa.chu@uspto.gov> schrieb im Newsbeitrag
news:26e901c373fa$013ba450$a101280a@phx.gbl...
[quoted text, click to view]

Ray
9/8/2003 8:57:37 AM

Under the installation of the .Net Framework, you should
have a program called "Quick Start tutorials." Inside
that web page there is a link called "Configuration
Details." Look on that page. There are some stored
procedures you have to run in order for ASP.NET to have
vvaddadi
11/5/2003 5:13:02 AM

I had a similar problem and was able to fix it by running the stored
procedures at command prompt as suggested by Ray. Thanks a bunch !!


--
AddThis Social Bookmark Button