473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

database login failed

I'm having a problem that i really don't understand. I'm new to ASP.NET and
to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work.

I think the problem is permissions but I'm not sure. I've tried adding the
ZEUS\ASPNET user to the server using osql with the command "EXEC
sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the
error page that was generated when I tried to build and run the site:
Server Error in '/MyWebForm' Application.
--------------------------------------------------------------------------------

Login failed for user 'ZEUS\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.SqlClient.SqlException: Login failed for user
'ZEUS\ASPNET'.

Source Error:

Line 26: public void FillDataSet(MyDataSet dSet)
Line 27: {
Line 28: sqlDataAdapter1.Fill(dSet);
Line 29: }
Line 30:

Source File: d:\inetpub\wwwroot\mywebform\component1.cs Line: 28

Stack Trace:

[SqlException: Login failed for user 'ZEUS\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
MyWebForm.Component1.FillDataSet(MyDataSet dSet) in
d:\inetpub\wwwroot\mywebform\component1.cs:28
MyWebForm.WebForm1.Page_Load(Object sender, EventArgs e) in
d:\inetpub\wwwroot\mywebform\webform1.aspx.cs:24
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Nov 19 '05 #1
4 1804
Do you have the connection string? Try using Trusted Connection and see
how that goes. You can get an example from www.connectionstrings.com

Aaron

Nov 19 '05 #2
Yes I tried using Trusted Connection. The result was pretty much the same...

I'll check the link - thanks...

"Aaron" <wi*****@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Do you have the connection string? Try using Trusted Connection and see
how that goes. You can get an example from www.connectionstrings.com

Aaron

Nov 19 '05 #3
First of all, it is much easier to use sql authentication. Try it first and
see if you can connect and the program works. Having done that, you can try
to switch to windows authentication. On the database server you need to
create a local user account with exactly the same user name and password as
the one for running asp.net on the web server. For example, if asp.net on
the web server runs under account "aspnet" with password "123456", you need
to create a local user account with user name "aspnet" and password "123456"
on the database server. Then you create a sql server logon for this local
account.

Eliyahu

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:uL**************@TK2MSFTNGP14.phx.gbl...
I'm having a problem that i really don't understand. I'm new to ASP.NET and to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work.

I think the problem is permissions but I'm not sure. I've tried adding the
ZEUS\ASPNET user to the server using osql with the command "EXEC
sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the
error page that was generated when I tried to build and run the site:
Server Error in '/MyWebForm' Application.
-------------------------------------------------------------------------- ------
Login failed for user 'ZEUS\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.SqlClient.SqlException: Login failed for user 'ZEUS\ASPNET'.

Source Error:

Line 26: public void FillDataSet(MyDataSet dSet)
Line 27: {
Line 28: sqlDataAdapter1.Fill(dSet);
Line 29: }
Line 30:

Source File: d:\inetpub\wwwroot\mywebform\component1.cs Line: 28

Stack Trace:

[SqlException: Login failed for user 'ZEUS\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
MyWebForm.Component1.FillDataSet(MyDataSet dSet) in
d:\inetpub\wwwroot\mywebform\component1.cs:28
MyWebForm.WebForm1.Page_Load(Object sender, EventArgs e) in
d:\inetpub\wwwroot\mywebform\webform1.aspx.cs:24
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Nov 19 '05 #4
Thanks for the response Eliyahu. I intend to try your suggestion when I get
more time.

I decided to go with what I know for now. I put the database in an XML Typed
Dataset. Since it's on a server where I'm the only one with access,
hopefully security won't be a problem and it bypasses the whole login issue.

"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:eH**************@TK2MSFTNGP14.phx.gbl...
First of all, it is much easier to use sql authentication. Try it first
and
see if you can connect and the program works. Having done that, you can
try
to switch to windows authentication. On the database server you need to
create a local user account with exactly the same user name and password
as
the one for running asp.net on the web server. For example, if asp.net on
the web server runs under account "aspnet" with password "123456", you
need
to create a local user account with user name "aspnet" and password
"123456"
on the database server. Then you create a sql server logon for this local
account.

Eliyahu

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:uL**************@TK2MSFTNGP14.phx.gbl...
I'm having a problem that i really don't understand. I'm new to ASP.NET

and
to SQL Server (MSDE). I'm trying to get a VS walkthru in the C# to work.

I think the problem is permissions but I'm not sure. I've tried adding
the
ZEUS\ASPNET user to the server using osql with the command "EXEC
sp_grantlogin 'ZEUS\ASPNET'" but it had no apparent effect. Below is the
error page that was generated when I tried to build and run the site:
Server Error in '/MyWebForm' Application.
--------------------------------------------------------------------------

------

Login failed for user 'ZEUS\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.SqlClient.SqlException: Login failed for

user
'ZEUS\ASPNET'.

Source Error:

Line 26: public void FillDataSet(MyDataSet dSet)
Line 27: {
Line 28: sqlDataAdapter1.Fill(dSet);
Line 29: }
Line 30:

Source File: d:\inetpub\wwwroot\mywebform\component1.cs Line: 28

Stack Trace:

[SqlException: Login failed for user 'ZEUS\ASPNET'.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnec
tionString
options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState)
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32

startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior)
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
MyWebForm.Component1.FillDataSet(MyDataSet dSet) in
d:\inetpub\wwwroot\mywebform\component1.cs:28
MyWebForm.WebForm1.Page_Load(Object sender, EventArgs e) in
d:\inetpub\wwwroot\mywebform\webform1.aspx.cs:24
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Maellic | last post by:
Hi, The website I am working on is built with ASP.NET and connects to a SQL Server 2000 database. The web server and database are on the same machine. I have recently tried to modify the timeout...
1
by: dk | last post by:
this is the DSN connection string in web.confi <add key="DSN" value="server=localhost;database=userDB;Integrated Security=SSPI" / any idea regarding what is causing this following error message...
0
by: Mr.KisS | last post by:
Hello. I'm under Windows XP PRO SP1, IIS 5.1 ans SQL SERVER 2005 Express. When i try to open a connexion with : <connectionStrings> <add name="AppCnxStr"...
2
by: Mr.KisS | last post by:
Hello. I'm under Windows XP PRO SP1, IIS 5.1 ans SQL SERVER 2005 Express. When i try to open a connexion with : <connectionStrings> <add name="AppCnxStr"...
1
by: Gopalan | last post by:
Hi Simple for you. Cannot open database requested in login 'TestDB'. Login fails. Login failed for user 'Computername\ASPNET' The user is given permission for accessing this DB the...
5
by: Ramtin | last post by:
Hi; when I use sql server connection or ole connection for working with database I receive the login failed for user 'any user that I work'.I've been granted ASPNET user in sql.
7
by: Deccypher | last post by:
Hi Im trying to do something a little more complex with my login script at the moment it works fine, checks the username and password with the database if its wrong it echo's a error and if its right...
2
by: kwankwan08 | last post by:
I try to access a same database using two different system, a) a window based system and b) a web based system. Both are using VB.NET. But it seem like the there is either one of them can...
3
by: David C | last post by:
I am getting the message below trying to open the SQL 2005 db in default.aspx. System.Data.SqlClient.SqlException: Cannot open database "Mydata" requested by the login. The login failed. Login...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.