473,750 Members | 2,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 22 '06 #1
5 2300

Użytkownik "Ramtin" <Ra****@discuss ions.microsoft. comnapisał w wiadomo¶ci
news:EF******** *************** ***********@mic rosoft.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
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.Sql Client.SqlExcep tion: 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.DataB ind();
Source File: c:\inetpub\wwwr oot\temp\webfor m1.aspx.cs Line: 32

Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.Sql Client.Connecti onPool.CreateCo nnection()
System.Data.Sql Client.Connecti onPool.UserCrea teRequest()
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
isInTransaction )

System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString options, Boolean& isInTransaction )
System.Data.Sql Client.SqlConne ction.Open()
Temp.WebForm1.P age_Load(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\temp\webfor m1.aspx.cs:32
System.Web.UI.C ontrol.OnLoad(E ventArgs e)
System.Web.UI.C ontrol.LoadRecu rsive()
System.Web.UI.P age.ProcessRequ estMain()

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****@discuss ions.microsoft. comnapisa³ w wiadomo¶ci
news:EF******** *************** ***********@mic rosoft.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
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.Sql Client.SqlExcep tion: 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.DataB ind();
Source File: c:\inetpub\wwwr oot\temp\webfor m1.aspx.cs Line: 32

Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.Sql Client.Connecti onPool.CreateCo nnection()
System.Data.Sql Client.Connecti onPool.UserCrea teRequest()
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
isInTransaction )

System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString options, Boolean& isInTransaction )
System.Data.Sql Client.SqlConne ction.Open()
Temp.WebForm1.P age_Load(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\temp\webfor m1.aspx.cs:32
System.Web.UI.C ontrol.OnLoad(E ventArgs e)
System.Web.UI.C ontrol.LoadRecu rsive()
System.Web.UI.P age.ProcessRequ estMain()

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****@discuss ions.microsoft. comnapisał w wiadomo¶ci
news:EF******** *************** ***********@mic rosoft.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
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
"cannontrod der" 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.Sql Client.SqlExcep tion: 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.DataB ind();
Source File: c:\inetpub\wwwr oot\temp\webfor m1.aspx.cs Line: 32

Stack Trace:
[SqlException: Login failed for user 'sa'.]
System.Data.Sql Client.Connecti onPool.CreateCo nnection()
System.Data.Sql Client.Connecti onPool.UserCrea teRequest()
System.Data.Sql Client.Connecti onPool.GetConne ction(Boolean&
isInTransaction )

System.Data.Sql Client.SqlConne ctionPoolManage r.GetPooledConn ection(SqlConne ctionString options, Boolean& isInTransaction )
System.Data.Sql Client.SqlConne ction.Open()
Temp.WebForm1.P age_Load(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\temp\webfor m1.aspx.cs:32
System.Web.UI.C ontrol.OnLoad(E ventArgs e)
System.Web.UI.C ontrol.LoadRecu rsive()
System.Web.UI.P age.ProcessRequ estMain()

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****@discuss ions.microsoft. comnapisa³ w wiadomo¶ci
news:EF******** *************** ***********@mic rosoft.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

Użytkownik "Ramtin" <Ra****@discuss ions.microsoft. comnapisał w wiadomo¶ci
news:96******** *************** ***********@mic rosoft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2645
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php'; global $LOGINDIR;
1
394
by: Ron L | last post by:
I am trying to setup a solution that will include a client which will access a database via remoting calls. I am hosting my remoting project in IIS, and am using Windows Integrated security. Since some of my users will be coming in through the web (from non-trusted domains) to log into their local domain account, I am trying to implement a login screen which will gather the user data (login, pwd, domain). The login screen will be...
3
3102
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 of the website from 20 mn to 60 mn. I changed the timeout setting in IIS. Now the website itself doesn't time out, however after 20 mn, when I try to access a page that needs to connect to the database, I get the following error message
1
1373
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 when the connection object trys to open tia d Server Error in '/FormsAuth' Application -------------------------------------------------------------------------------
1
1363
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 connection string is:
3
5763
by: Mad Scientist Jr | last post by:
I am getting the following error when trying to access a database with a trusted connection: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." My connection string is: "Server=MyServer; Database=MyCatalog; Trusted_Connection=True;"
10
1495
by: SAL | last post by:
Hello, I'm still having trouble getting my app to authenticate correctly. I have read the tips at: http://www.devhood.com/messages/message_view-2.aspx?thread_id=72204 and am still having trouble making this happen correctly. Here are my settings. SQL Server 2005 db access is required Web page Anonymous access is turned off in IIS.
2
2722
by: ramaswamynanda | last post by:
Hello All, I have an application using ASP.NET. The database is SQLServer Express 2005. There is a table called ApartmentInfo in the database. All i am trying to do, is to "select * from ApartmentInfo" into a repeater control on an asp.net page. This is the connection code i am using - Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dbconn, sql, dbcomm, dbread ...
7
3360
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 redirects the user to the main page with the session variable logged_in = true but what i have done now is added more feileds into the user table name company email ect. what i want to do is on successful login pull the users information and...
0
8999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9575
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6803
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.