Why DataSet always returns null?
-
His purpose was to clear object DataSet in section finally. But, do you guys think the DataSet will be cleared if no error is caught?
private bool CheckData()
{
DataSet ds = null;
try
{
//Get Data, and fill ds
//if there is data in the ds's table
return true;
}
catch{}
finally
{
ds = null;
}return false;
}
Uhh...yes? That's the entire point of the Finally... statement. :doh:
“Acer, Gateway, and eMachines are the same company now. Great! Now we just need a really big toilet, and we can get rid of all three at once.”
-
"A little knowledge is a dangerous thing." -- Alexander Pope
Just to be pedantic - Pope's quotation is actually "A little learning is a dangerous thing"
==================================== Transvestites - Roberts in Disguise! ====================================
-
That said, I suggest you and your cow-orker might want to start by learning what the finally block does.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall