ExecuteReader returning null
Posted by: Richard Whitehead
Date: May 28, 2009 09:53AM

Can anyone explain why ExecuteReader is sometimes returning null? The connection object looks fine, and is open, and the query is straightforward and usually returns results. But sometimes it's null.
I'm not getting any exceptions.
This is being triggered by a windows timer but the code should be single-threaded.
Can anyone help? Any suggestions very welcome.


using ( MySqlCommand command = new MySqlCommand( query, connection ) )
{
using ( MySqlReader reader = command.ExecuteReader )
{
// <-- reader is sometimes null here
}
}

Options: ReplyQuote


Subject
Written By
Posted
ExecuteReader returning null
May 28, 2009 09:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.