From: Timothy S. <tim...@ya...> - 2004-04-15 20:46:18
|
The following code throws an error: FbCommand cmd = null; try { FbConnection connection = new Connection(_connString); cmd = connection.CreateCommand(); cmd.CommandText = selectstring; reader = cmd.ExecuteReader(); } catch (Exception ) {} finally { if(cmd!=null) cmd.Dispose(); } The error is thrown on the Dispose() method with the following message: Object reference not set to an instance of an object. Upon further investigation, I have found that this is because there is no Transaction object in the FbCommand. If I just put one in there, it works fine. I did not think that it was necessary for queries to require transaction objects. Is this expected behavior? -Tim __________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html |