By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 3,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

Problem with database (Login failed for user 'X')

P: n/a
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.
Jul 22 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

Użytkownik "Ramtin" <Ra****@discussions.microsoft.comnapisał w wiadomości
news:EF**********************************@microsof t.com...
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.
Give us more data. Some line with error description, line with code etc.
There are many possible reasons.
--
JS
BRE Bank Dev Team, Poland
Jul 22 '06 #2

P: n/a
Hi;
Thanks for your attention.I have not any problem with windows
application.the exact message that I recieve in web application is this:
(some description is below)
Server Error in '/Temp' Application.
--------------------------------------------------------------------------------

Login failed for user 'sa'.
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
'sa'.

Source Error:
Line 30: if(!IsPostBack)
Line 31: {
Line 32: sqlConnection1.Open();
Line 33: sqlDataAdapter1.Fill(dataSet11);
Line 34: DataGrid1.DataBind();
Source File: c:\inetpub\wwwroot\temp\webform1.aspx.cs Line: 32

Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.SqlClient.ConnectionPool.CreateConnect ion()
System.Data.SqlClient.ConnectionPool.UserCreateReq uest()
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
Temp.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\temp\webform1.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

This occurs when I use local sql server.when I use other sql server on the
network I give "server is not exist" message.I follow this steps:
1) I create a sqlconnection 2)I set a sql statement in a data adapter
3)generate a data set 3)in page load event I add above codes.
"Jacek Stawicki" wrote:
>
UÂżytkownik "Ramtin" <Ra****@discussions.microsoft.comnapisaÂł w wiadomoÂści
news:EF**********************************@microsof t.com...
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.

Give us more data. Some line with error description, line with code etc.
There are many possible reasons.
--
JS
BRE Bank Dev Team, Poland
Jul 23 '06 #3

P: n/a
You are trying to connect using SA as the user. Try to connect using
sql management studio or query analyser using sql authentication.

Note: it's not a good idea AT ALL to connect using the sa account.
ASP.NET applications run under a particular username (in my case
ASPNET). It's best to use windows authentication and grant access to
the unprivileged account that asp.net applications run under.
Ramtin wrote:
Hi;
Thanks for your attention.I have not any problem with windows
application.the exact message that I recieve in web application is this:
(some description is below)
Server Error in '/Temp' Application.
--------------------------------------------------------------------------------

Login failed for user 'sa'.
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
'sa'.

Source Error:
Line 30: if(!IsPostBack)
Line 31: {
Line 32: sqlConnection1.Open();
Line 33: sqlDataAdapter1.Fill(dataSet11);
Line 34: DataGrid1.DataBind();
Source File: c:\inetpub\wwwroot\temp\webform1.aspx.cs Line: 32

Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.SqlClient.ConnectionPool.CreateConnect ion()
System.Data.SqlClient.ConnectionPool.UserCreateReq uest()
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
Temp.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\temp\webform1.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

This occurs when I use local sql server.when I use other sql server on the
network I give "server is not exist" message.I follow this steps:
1) I create a sqlconnection 2)I set a sql statement in a data adapter
3)generate a data set 3)in page load event I add above codes.
"Jacek Stawicki" wrote:

Użytkownik "Ramtin" <Ra****@discussions.microsoft.comnapisał w wiadomości
news:EF**********************************@microsof t.com...
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.
Give us more data. Some line with error description, line with code etc.
There are many possible reasons.


--
JS
BRE Bank Dev Team, Poland

Jul 23 '06 #4

P: n/a
Hi; The sa user is for example I'd been using so many different users.But
finally I use the other post and solve my problem.I must add UID and PWD in
connection string

Thanks for your attention
"cannontrodder" wrote:
You are trying to connect using SA as the user. Try to connect using
sql management studio or query analyser using sql authentication.

Note: it's not a good idea AT ALL to connect using the sa account.
ASP.NET applications run under a particular username (in my case
ASPNET). It's best to use windows authentication and grant access to
the unprivileged account that asp.net applications run under.
Ramtin wrote:
Hi;
Thanks for your attention.I have not any problem with windows
application.the exact message that I recieve in web application is this:
(some description is below)
Server Error in '/Temp' Application.
--------------------------------------------------------------------------------

Login failed for user 'sa'.
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
'sa'.

Source Error:
Line 30: if(!IsPostBack)
Line 31: {
Line 32: sqlConnection1.Open();
Line 33: sqlDataAdapter1.Fill(dataSet11);
Line 34: DataGrid1.DataBind();
Source File: c:\inetpub\wwwroot\temp\webform1.aspx.cs Line: 32

Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.SqlClient.ConnectionPool.CreateConnect ion()
System.Data.SqlClient.ConnectionPool.UserCreateReq uest()
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
Temp.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\temp\webform1.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

This occurs when I use local sql server.when I use other sql server on the
network I give "server is not exist" message.I follow this steps:
1) I create a sqlconnection 2)I set a sql statement in a data adapter
3)generate a data set 3)in page load event I add above codes.
"Jacek Stawicki" wrote:
>
UÂżytkownik "Ramtin" <Ra****@discussions.microsoft.comnapisaÂł w wiadomoÂści
news:EF**********************************@microsof t.com...
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.
>
Give us more data. Some line with error description, line with code etc.
There are many possible reasons.
>
>
--
JS
BRE Bank Dev Team, Poland
>
>
>

Jul 23 '06 #5

P: n/a

Użytkownik "Ramtin" <Ra****@discussions.microsoft.comnapisał w wiadomości
news:96**********************************@microsof t.com...
Hi; The sa user is for example I'd been using so many different users.But
finally I use the other post and solve my problem.I must add UID and PWD
in
connection string

What is the connection string?
--
JS
BRE Bank Dev Team, Poland
Jul 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.