469,354 Members | 2,035 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,354 developers. It's quick & easy.

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 23711
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Gopalan | last post: by
3 posts views Thread by David C | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.