T
timtos
Hi.
I have to use a database in my c# program.
For that I created a MySqlManager class.
If it is being instanciated a connection will be established like this:
odbcConnection = new OdbcConnection(connectionTarget);
odbcConnection.Open();
(where connectionTarget is a string describing the database access)
I do not close this connection until the main program is terminated.
Is that a good way or is it better to open and close it for every task?
I am asking because I´ve got a problem with the database access.
My program is running 5 or 6 times great and after that I receive an
odbc connection error. I thought that it could be possible that I get
this error if I do not close the connection properly?!?!
After logging in to windows again everything is working fine - for 5 or 6 times...
Thanks for any tips and tricks,
timtos.
I have to use a database in my c# program.
For that I created a MySqlManager class.
If it is being instanciated a connection will be established like this:
odbcConnection = new OdbcConnection(connectionTarget);
odbcConnection.Open();
(where connectionTarget is a string describing the database access)
I do not close this connection until the main program is terminated.
Is that a good way or is it better to open and close it for every task?
I am asking because I´ve got a problem with the database access.
My program is running 5 or 6 times great and after that I receive an
odbc connection error. I thought that it could be possible that I get
this error if I do not close the connection properly?!?!
After logging in to windows again everything is working fine - for 5 or 6 times...
Thanks for any tips and tricks,
timtos.