[Mono-bugs] [Bug 68750][Cri] New - NullReferenceException when calling ExecuteScalar

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 25 Oct 2004 03:22:44 -0400 (EDT)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by accounts@sandmik.net.


--- shadow/68750	2004-10-25 03:22:44.000000000 -0400
+++ shadow/68750.tmp.19597	2004-10-25 03:22:44.000000000 -0400
@@ -0,0 +1,79 @@
+Bug#: 68750
+Product: Mono: Class Libraries
+Version: unspecified
+OS: other
+OS Details: Windows (mono-1.0.2-gtksharp-1.0.2-win32-0.7) and Linux (Mono 1.0.2)
+Status: NEW   
+Priority: Critical
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: accounts@sandmik.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: NullReferenceException when calling ExecuteScalar
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+Whenever you run a certain code that queries the database, you have
+the NullReferenceException thrown.
+Steps to reproduce the problem:
+OdbcConnection odbcConnection = new OdbcConnection();
+CODBCConnectionManager.password = "";
+odbcConnection.ConnectionString = CODBCConnectionManager.connectionString;
+OdbcCommand checklocked = odbcConnection.CreateCommand();
+checklocked.CommandText = "SELECT count(logid) FROM ADMINSLOGINSLOG WHERE 
+checklocked.Parameters.Add("@adminid", OdbcType.Int, 1);
+OdbcParameter param = checklocked.Parameters.Add("@lockedtransdate", 
+param.Value = DateTime.Now;
+int count = Convert.ToInt32(checklocked.ExecuteScalar());
+Actual Results:
+System.NullReferenceException: Object reference not set to an instance of 
+an objectin <0x0005b> System.Data.Odbc.OdbcParameter:setBuffer ()
+in <0x00027> System.Data.Odbc.OdbcParameter:Bind (intptr,int)
+in <0x00062> (wrapper remoting-invoke-with-check) 
+System.Data.Odbc.OdbcParameter:Bind (intptr,int)
+in <0x00260> System.Data.Odbc.OdbcCommand:Prepare ()
+in <0x00032> System.Data.Odbc.OdbcCommand:ExecSQL (string)
+in <0x00090> System.Data.Odbc.OdbcCommand:ExecuteNonQuery (bool)
+in <0x00011> System.Data.Odbc.OdbcCommand:ExecuteReader 
+in <0x00010> System.Data.Odbc.OdbcCommand:ExecuteReader ()
+in <0x00023> System.Data.Odbc.OdbcCommand:ExecuteScalar ()
+in <0x0004d> (wrapper remoting-invoke-with-check) 
+System.Data.Odbc.OdbcCommand:ExecuteScalar ()
+in <0x0011d> FPBill.temp:Page_Load (object,System.EventArgs)
+in <0x00066> (wrapper delegate-invoke) 
+in <0x00064> System.Web.UI.Control:OnLoad (System.EventArgs)
+in <0x0002b> System.Web.UI.Control:LoadRecursive ()
+in <0x00139> System.Web.UI.Page:InternalProcessRequest ()
+in <0x000a1> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
+in <0x002c8> ExecuteHandlerState:Execute ()
+in <0x00074> StateMachine:ExecuteState 
+Expected Results:
+To work without errors, this works normally on Windows .NET platform
+How often does this happen? 
+Additional Information: