Ask about OO concept

Jun 25 2009 8:27 PM
hi friends, and wanna ask you:

1. what is the different between this code

catch (OleDbException ex)
            {
                throw ex;
            }

and

catch (OleDbException ex)
            {
                throw new Exception(ex.Messege);
            }

which is the best? or when should we use throw new Exception or just throw ex?


2. What about close() and dispose() method, what is the different?
if there is objek like OleDbDataReader which have close() and method() inside,
should we write objOleDbDataReader.close() and objOleDbDataReader.dispose() together in our code? why?
if we should only use one of them, which one should we use, close() or dispose() ?

Thanks..

Regards,

Willy


Answers (1)