Click here to Skip to main content
15,883,278 members

Comments by Rafael Nicoletti (Top 1 by date)

Rafael Nicoletti 2-May-16 15:38pm View    
OK, the error by itself tell's what's happening. You clicked and then clicked again.

You need to close/dispose all "external resources":

mdr.Close();
mdr.Dispose();
cmd.Dispose();

The code above isn't the best way to write code. Optimally you should use Dispose pattern by using "using keyword" or dispose/close your resources in the "finally" portion of your try/catch statements.