when should I close the connection ??

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

In my one form, the user need to search many field, e.g customer name,
country name, currency.. etc
They are using the same conMaster , So, when Should I closed the connection
??
1st) if the user search customer, conMaster.open, after finish searching ,
conMaster.close .
AND if the user search country, conMaster.open,after.. that.
conMaster.close

2nd) or, conMaster.close (as the user close the form ??)
FromAgnes
June - my third month [vb.net & sql development]
 
Hi Agnes,

In any database except MS access like ones, as much as possible and reopen
it when needed.

When it is about a SQL server with much connections (plus 100) then you even
can do better dispose and add the connectionstring again before the open.

I hope this helps?

Cor
 
Back
Top