Problem with database (Login failed for user 'X')  
Author Message
ekonomix





PostPosted: Sat Jul 22 16:25:36 CDT 2006 Top

ASP.Net >> Problem with database (Login failed for user 'X') 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.

Web Programming58  
 
 
Jacek





PostPosted: Sat Jul 22 16:25:36 CDT 2006 Top

ASP.Net >> Problem with database (Login failed for user 'X')
U¿ytkownik "Ramtin" <EMail@HideDomain.com> napisa³ w wiadomo¶ci
news:EMail@HideDomain.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


 
 
Ramtin





PostPosted: Sun Jul 23 05:30:01 CDT 2006 Top

ASP.Net >> Problem with database (Login failed for user 'X') 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.CreateConnection()
System.Data.SqlClient.ConnectionPool.UserCreateRequest()
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(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" <EMail@HideDomain.com> napisa³ w wiadomo¶ci
> news:EMail@HideDomain.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
>
>
>
 
 
cannontrodder





PostPosted: Sun Jul 23 05:47:43 CDT 2006 Top

ASP.Net >> Problem with database (Login failed for user 'X') 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 a=
bout
> the error and where it originated in the code.
>
> Exception Details: System.Data.SqlClient.SqlException: Login failed for u=
ser
> '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.CreateConnection()
> System.Data.SqlClient.ConnectionPool.UserCreateRequest()
> System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> isInTransaction)
>
> System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlCon=
nectionString 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=BFytkownik "Ramtin" <EMail@HideDomain.com> napisa=B3 w wi=
adomo=B6ci
> > news:EMail@HideDomain.com...
> > > Hi; when I use sql server connection or ole connection for working wi=
th
> > > 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.
> >=20
> >=20
> > --=20
> > JS
> > BRE Bank Dev Team, Poland=20
> >=20
> >=20
> >

 
 
Ramtin





PostPosted: Sun Jul 23 05:55:01 CDT 2006 Top

ASP.Net >> Problem with database (Login failed for user 'X') 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.CreateConnection()
> > System.Data.SqlClient.ConnectionPool.UserCreateRequest()
> > System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
> > isInTransaction)
> >
> > System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(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" <EMail@HideDomain.com> napisa³ w wiadomo¶ci
> > > news:EMail@HideDomain.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
> > >
> > >
> > >
>
>
 
 
Jacek





PostPosted: Sun Jul 23 05:59:52 CDT 2006 Top

ASP.Net >> Problem with database (Login failed for user 'X')
U¿ytkownik "Ramtin" <EMail@HideDomain.com> napisa³ w wiadomo¶ci
news:EMail@HideDomain.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