Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > database login failed

Reply
Thread Tools

database login failed

 
 
Chuck Bowling
Guest
Posts: n/a
 
      07-03-2005
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()



 
Reply With Quote
 
 
 
 
Aaron
Guest
Posts: n/a
 
      07-03-2005
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

 
Reply With Quote
 
 
 
 
Chuck Bowling
Guest
Posts: n/a
 
      07-03-2005
Yes I tried using Trusted Connection. The result was pretty much the same...

I'll check the link - thanks...

"Aaron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      07-04-2005
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" <(E-Mail Removed)> wrote in message
news:uLOqYW$(E-Mail Removed)...
> 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()
>
>
>



 
Reply With Quote
 
Chuck Bowling
Guest
Posts: n/a
 
      07-05-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:uLOqYW$(E-Mail Removed)...
>> 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()
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Cannot open user default database. Login failed. Login failed for user 'HEMPC\ASPNET' Tony Johansson ASP .Net 3 01-02-2010 04:09 PM
Cannot open database requested in login 'HumanResources'. Login failed for user 'companyDomain\BOSIIS$'. Homer ASP .Net 3 09-25-2007 07:45 PM
Cannot open database requested in login "DBName" Login failed for Max ASP .Net Security 0 12-20-2005 11:09 PM



Advertisments