public string GetSomething()
{ var a = String.Empty;
try
{
// loop through the datareader
return "some data";
}
finally
{
reader.close();
}
return whatever;
}
views:
35answers:
2
+2
A:
The code in the finally block will get executed. You may want to call reader.dispose(). I like to use the using{} statement myself.
Gratzy
2009-09-23 15:32:37
+1 for using using
Aidan
2009-09-23 15:39:55