Problem with connection

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
 
M

Mark Rae

"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...?
 
A

Aahz

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.
 
M

Mark Rae

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...?
 
A

Aahz

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
 
M

Mark Rae

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... :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top