error handle for reconnect question
Posted: Thu 19 Jun 2014 02:43
I call the function in try catch block
In catch block want to reconnect
which is the properly ways below?
1.set old PgSqlConnection object to null
,create the new PgSqlConnection object then call Open function
2.without create new object,just call Open again
3.without create new object,call Close then call Open
Code: Select all
PgSqlConnection.Open()
which is the properly ways below?
1.set old PgSqlConnection object to null
,create the new PgSqlConnection object then call Open function
2.without create new object,just call Open again
3.without create new object,call Close then call Open