error handle for reconnect question

error handle for reconnect question

Postby waertf » Thu 19 Jun 2014 02:43

I call the function in try catch block
Code: Select all
PgSqlConnection.Open()

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
waertf
 
Posts: 9
Joined: Sat 07 Jun 2014 01:52

Re: error handle for reconnect question

Postby Pinturiccio » Thu 19 Jun 2014 15:44

The properly way is way 3:
waertf wrote:3.without create new object,call Close then call Open
Pinturiccio
Devart Team
 
Posts: 2020
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for PostgreSQL