473,769 Members | 3,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot open database requested in login 'x'. Login failed for user

I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I have
an error trap that picks up this error. When it happens, I'll get 10 to 30
in a row, then it goes away for a week or so. It always comes back though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above variables.
I then dispose my glogal module.
Jan 8 '06 #1
7 23922
Just this user - or all users?

Database in the process of starting up?

You'll need to provide some more info

"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:12******** *************** ***********@mic rosoft.com...
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I
have
an error trap that picks up this error. When it happens, I'll get 10 to
30
in a row, then it goes away for a week or so. It always comes back
though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above
variables.
I then dispose my glogal module.

Jan 8 '06 #2
Hello

Is your Web Application is on the Deployment Server?. If so , as far as i
think you have Connection Size Problem, check out that how many connections
can be created at a single time.


"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:12******** *************** ***********@mic rosoft.com...
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I
have
an error trap that picks up this error. When it happens, I'll get 10 to
30
in a row, then it goes away for a week or so. It always comes back
though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above
variables.
I then dispose my glogal module.

Jan 8 '06 #3
Brian,
The best-practices pattern is:

1)Create and open the SqlConnection (if the connection string is the same,
it will come out of the connection pool, which gives you 100 pooled
connections)

2) do your work.

3) CLOSE the connection, allowing it to return to the pool.

Your post isn't clear enough to tell whether or not you are actually doing
this, but I bet if you refactored your code to do so the problem will go
away.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Brian Kitt" wrote:
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I have
an error trap that picks up this error. When it happens, I'll get 10 to 30
in a row, then it goes away for a week or so. It always comes back though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above variables.
I then dispose my glogal module.

Jan 8 '06 #4
This is during normal day to day running of my website. My website has a
specific userid for the database, and this is a dedicated server for this
website only. SQL server is on the same machine as IIS. The userid works
almost all of the time, but just during some time frames, it has this error.
This website is what I would refer to as low to medium usage.

"Jim Ryder" wrote:
Just this user - or all users?

Database in the process of starting up?

You'll need to provide some more info

"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:12******** *************** ***********@mic rosoft.com...
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I
have
an error trap that picks up this error. When it happens, I'll get 10 to
30
in a row, then it goes away for a week or so. It always comes back
though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above
variables.
I then dispose my glogal module.


Jan 9 '06 #5
Oh, it is VERY possible that if I am at a peak usage period, that we could
exceed the maximum number of connections. I'll look into that and see.
Thanks for the tip.

"Ali Raza Shaikh" wrote:
Hello

Is your Web Application is on the Deployment Server?. If so , as far as i
think you have Connection Size Problem, check out that how many connections
can be created at a single time.


"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:12******** *************** ***********@mic rosoft.com...
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I
have
an error trap that picks up this error. When it happens, I'll get 10 to
30
in a row, then it goes away for a week or so. It always comes back
though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above
variables.
I then dispose my glogal module.


Jan 9 '06 #6
I think that the 100 may be the problem.
This website, opens and searches multiple tables at the same time. It will
open 11 connections, search 11 tables simultaneously, then close all 11
connections. If 10 people get in simultaneously, then we've exceeded 100.
That is probably what my problem is. I'll look into that.

Is there a better way of searching 11 tables simultaneously (using full text
search) rather than 11 seperate connections?

"Peter Bromberg [C# MVP]" wrote:
Brian,
The best-practices pattern is:

1)Create and open the SqlConnection (if the connection string is the same,
it will come out of the connection pool, which gives you 100 pooled
connections)

2) do your work.

3) CLOSE the connection, allowing it to return to the pool.

Your post isn't clear enough to tell whether or not you are actually doing
this, but I bet if you refactored your code to do so the problem will go
away.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Brian Kitt" wrote:
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I have
an error trap that picks up this error. When it happens, I'll get 10 to 30
in a row, then it goes away for a week or so. It always comes back though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above variables.
I then dispose my glogal module.

Jan 9 '06 #7
Well it depends. If I had to search 11 tables I'd do it all in the same
stored procedure first, and accumulate the results either in a table variable
or whatever, then return the entire resultset in one shot.

I suppose you could make the case that 11 simultaneous table searches might
be more performant, it depends how soon you need all your data back.

You can increase the default connections in the pool. As well, each
connection pool is associated with a single connection string, so you could
use more than one connection string, each different to get more "pool action".

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Brian Kitt" wrote:
I think that the 100 may be the problem.
This website, opens and searches multiple tables at the same time. It will
open 11 connections, search 11 tables simultaneously, then close all 11
connections. If 10 people get in simultaneously, then we've exceeded 100.
That is probably what my problem is. I'll look into that.

Is there a better way of searching 11 tables simultaneously (using full text
search) rather than 11 seperate connections?

"Peter Bromberg [C# MVP]" wrote:
Brian,
The best-practices pattern is:

1)Create and open the SqlConnection (if the connection string is the same,
it will come out of the connection pool, which gives you 100 pooled
connections)

2) do your work.

3) CLOSE the connection, allowing it to return to the pool.

Your post isn't clear enough to tell whether or not you are actually doing
this, but I bet if you refactored your code to do so the problem will go
away.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Brian Kitt" wrote:
I frequently get the above error on my website. It happens only for short
periods of times, then the error goes away. I cannot recreate this. I have
an error trap that picks up this error. When it happens, I'll get 10 to 30
in a row, then it goes away for a week or so. It always comes back though.
It's driving me crazy.

At the start of a web page, I instantiate a 'global' module.
The global module sets all of the connection variables.
I then do my sql commands, which sporadically result in the above variables.
I then dispose my glogal module.

Jan 9 '06 #8

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

Similar topics

2
9583
by: Nans | last post by:
One basic ASP.NET database issue…. I have a c# app running on a iis6 on one win2k3 adv servermachine & database on other win2k server machine…(in the same domain) Using windows authentication in web.config. Set impersonate =true . Connection string has Integrated security=SSPI. Logging in with my ID which is system administrator and has rights all DBs on the sql machine. But still, I get this error..(even I tried putting for test...
0
2132
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" connectionString="Server=KLEO\SQLEXPRESS;Integrated Security=True;Database=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\wizou.mdf" providerName="System.Data.SqlClient" />
2
10650
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" connectionString="Server=KLEO\SQLEXPRESS;Integrated Security=True;Database=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\wizou.mdf" providerName="System.Data.SqlClient" />
1
1366
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:
1
1985
by: bennett | last post by:
I'm trying to write an ASPX page that uses an OleDbDataAdapter to get data from a SQL Server database. When I test the connection, it returns success, and when I preview the data using the Adapter's "preview data" right-click option, it works, but when I load the actual page, I get the error "Cannot open database requested in login 'cookiecutter'. Login fails." It seems to work when I use a pre-existing database like Northwind or...
2
3205
by: Homer | last post by:
Hi, I have an ASP.NET 2.0 Intranet app that works fine on a test server running on Win2003 Server with IIS 6.0. However, it fails when I port it over to the production server running on the same OS. I compared all the configurations and everything matches. I then re-run the aspnet_regiis; I even granted "NT AUTHORITY\NETWORK SERVICE" full access to aspnet_Membership and aspnet_Roles. I don't know why the app uses a local user...
0
981
by: gopim | last post by:
Cannot open database requested in login 'constant'. Login fails. Login failed for user user1. some times i got this error in my website . how to solve this problem very urgent
3
1369
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 failed for user 'MYXP\generic' The web site is on an XP machine with 2005 Express. I setup a login called generic on our domain and then put that login and password into the identity impersonate section of web.config
1
2851
by: mrkarthic | last post by:
We are using SQL Server 2005 Express Edition. It has been observed that sometimes our application crashes and from the logs recovered the following sql exception was found. "Cannot open database requested in login 'teachdb'. Login fails.' ". Though the behavior is sporadic, it is critical for us. Restarting SQL Server some times help, but we cannot expect the client to do so since it would impact other applications running. Has anybody...
0
9590
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
10223
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
10000
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
9866
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
7413
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
6675
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
5310
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
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.