473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 23901
Just this user - or all users?

Database in the process of starting up?

You'll need to provide some more info

"Brian Kitt" <Br*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.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*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.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*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.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*******@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.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
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...
0
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"...
2
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"...
1
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...
1
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...
2
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...
0
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
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.