using c# vs2008 winforms.
My standard forms have a typical usage pattern of
Form load
Sqlconnection object open.
read/write datasets using sqldataadaptors
read many things using sql readers
write many data using stored procedures to write
close sql connection
close form
So whats best practice in handling exceptions in this type of usage pattern I enclose all read and write code to the sql server in try catch clauses to trap exceptions.
So what do i do when i trap an exception ?
Should i close and dispose all sql objects ?
Should i close the form and dispose the form.
Should i try to let the user continue on
Should i try to re-open my sqlconnection if the exception is that the sql connection broken ?
Given that i open and close connections on form load and close, as that it only in theory opens once and closes once with many reads and writes inbetween.
I'm just not sure what action i should be taking when i trap an exception, to prevent memory and resource leaks.
any advice appreciated
thanks