Problem with connection

  • Thread starter Thread starter Aahz
  • Start date Start date
A

Aahz

Hello, I have website in asp.net and mysql database. There is some
pages on site that have connections to database created trough c# code
(with connection strings, database adapters, datareaders..etc).

Problem is strange: it works fine for a while, then every few days
just stops by itself, visitors got message "error, access denied for
user....." Solution is actually simple I just go to Control panel and
retype same password for user and after that works fine again ...
but of course I want to stop this happening every 5-10 days. Strange,
isn't it ?

I would like to know what causes of this problem, but now I just have
no idea where to look?

Anybody had similar experience?

Thanks
 
"error, access denied for user....."

It that the *precise* error message? I.e. it doesn't specify for which user
access is being denied...?

If so, sounds like your app has recycled, which has caused it to forget its
connection string...

How / where are you specifying this...? E.g. Application_Start or somewhere
else...?
 
Mark Rae je napisao:
It that the *precise* error message? I.e. it doesn't specify for which user
access is being denied...?

If so, sounds like your app has recycled, which has caused it to forget its
connection string...

How / where are you specifying this...? E.g. Application_Start or somewhere
else...?

I have only one user that web application use to access database, and
when it happens it clearly tells access denied for THAT user.
All OdbcConnections, OdbcCommands ,etc ...are stored in C# code of
every page so when compiled it goes to dll file, right?

I appreciate any help.
 
I have only one user that web application use to access database, and
when it happens it clearly tells access denied for THAT user.
All OdbcConnections, OdbcCommands ,etc ...are stored in C# code of
every page so when compiled it goes to dll file, right?

Hmm - OK... Do you have access to the webserver's EventLog? If so, is there
anything obvious in that e.g. a networking issue, the MySQL service
recycling etc...?

Also, I'm curious as to why you're using ODBC...? There are perfectly
serviceable native .NET providers available for MySQL, including from MySQL
themselves: http://www.connectionstrings.com/?carrier=mysql

Is there any reason why you don't use one of these or, at the *very* least,
OleDb...?
 
Mark Rae je napisao:
Hmm - OK... Do you have access to the webserver's EventLog? If so, is there
anything obvious in that e.g. a networking issue, the MySQL service
recycling etc...?

Also, I'm curious as to why you're using ODBC...? There are perfectly
serviceable native .NET providers available for MySQL, including from MySQL
themselves: http://www.connectionstrings.com/?carrier=mysql

Is there any reason why you don't use one of these or, at the *very* least,
OleDb...?

Reason would be: my lack of knowledge ;)
I don't have access to my servers EventLog but perhaps my hosting
provider does
 
Reason would be: my lack of knowledge ;)

See the following page from the mySQL website:
http://dev.mysql.com/tech-resources/articles/dotnet/ and scroll right down
to the bottom - you will almost certainly find that you will get a major
performance boost by using their native .NET data provider...
I don't have access to my servers EventLog but perhaps my hosting
provider does

Your ISP will certainly have access to it - whether they will give you
access to it, or even just extract it and mail it to you, is another matter
entirely... :-)
 
Back
Top