473,574 Members | 3,158 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 23912
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
9576
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...
0
2112
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
10639
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
1354
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
1971
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...
2
3200
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"...
0
975
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
1358
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...
1
2841
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...
0
7764
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...
0
8274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7863
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...
0
8140
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...
0
6514
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5660
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...
0
3795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1375
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.