[Mono-bugs] [Bug 77622][Nor] New - I am trying a simple program that tries to display records from MS-access database's table (accessed through a System DSN), runs fine with .NET but encountering error with Mono.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Feb 23 06:32:01 EST 2006


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 ankurj at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77622

--- shadow/77622	2006-02-23 06:32:01.000000000 -0500
+++ shadow/77622.tmp.28569	2006-02-23 06:32:01.000000000 -0500
@@ -0,0 +1,132 @@
+Bug#: 77622
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: XP Professsional Edition with SP2 installed
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: tsenganal at novell.com                            
+ReportedBy: ankurj at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: I am trying a simple program that tries to display records from MS-access database's table (accessed through a System DSN), runs fine with .NET but encountering error with Mono.
+
+----------------------------------------------------------------------------------------------------------------
+DataBase : db2.mdb (Microsoft Access 2000, SP1 installed)
+----------------------------------------------------------------------------------------------------------------
+Note : Created a System DSN from Control Panel : "AccessDSN"
+
+emp_id	name		age
+------  -----------     ----
+1	Ankur Jain	23
+2	Ankit Jain	24
+
+
+DataTypes:
+
+emp_id : AutoNumber (Primary Key)
+name   : Text
+age    : Number
+----------------------------------------------------------------------------------------------------------------
+try.cs (C# Class)
+----------------------------------------------------------------------------------------------------------------
+using System;
+using System.Data;
+using System.Data.Odbc;
+
+namespace Db_Access
+{
+    class MainClass
+    {
+
+        public static void Main(string [] args) {
+            string ConnectionString = "DSN=AccessDSN;";
+            string CommandString  = "SELECT * FROM employee";
+            OdbcConnection conn = new OdbcConnection(ConnectionString);
+            OdbcCommand comm = new OdbcCommand(CommandString, conn);
+            try {
+                conn.Open();
+                IDataReader reader = comm.ExecuteReader();
+                Console.WriteLine("Data Returned from All Folder\n");
+                while(reader.Read()) {
+                    try {
+                        Console.WriteLine("{0}\t {1}",reader.GetString(0),
+reader.GetString(1));
+                    }
+                    catch (Exception e) {
+                        Console.WriteLine("End {0}", e.StackTrace.ToString());
+                    }
+                }
+                reader.Close();
+                conn.Close();
+            }
+            catch (OdbcException e) {
+                Console.WriteLine("Error: {0}\n", e.Errors[0].Message);
+            }
+            Console.ReadLine();
+        }
+    }
+}
+
+----------------------------------------------------------------------------------------------------------------
+Microsoft .NET version: v2.0.50727
+----------------------------------------------------------------------------------------------------------------
+
+C:\Documents and Settings\Administrator\Desktop>csc try.cs
+Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
+for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
+Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
+
+
+C:\Documents and Settings\Administrator\Desktop>try.exe
+Data Returned from All Folder
+
+1        Ankur Jain
+2        Ankit Jain
+
+
+C:\Documents and Settings\Administrator\Desktop>
+
+----------------------------------------------------------------------------------------------------------------
+MONO Version : 1.1.13.2 running on Windows XP (SP2 installed)
+----------------------------------------------------------------------------------------------------------------
+
+C:\Documents and Settings\Administrator\Desktop>mcs try.cs -r:System.Data.dll
+
+C:\Documents and Settings\Administrator\Desktop>mono try.exe
+
+Unhandled Exception: System.NullReferenceException: Object reference not set to
+an instance of an object
+in <0x000a6> System.Data.Odbc.OdbcDataReader:GetPrimaryKeys (System.String
+catal
+og, System.String schema, System.String table)
+in <0x00b62> System.Data.Odbc.OdbcDataReader:GetSchemaTable ()
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcDataReader:GetSchem
+aTable ()
+in <0x00094> System.Data.Odbc.OdbcDataReader:.ctor
+(System.Data.Odbc.OdbcCommand
+ command, CommandBehavior behavior)
+in <0x00010> System.Data.Odbc.OdbcDataReader:.ctor
+(System.Data.Odbc.OdbcCommand
+ command, CommandBehavior behavior, Int32 recordAffected)
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcDataReader:.ctor (S
+ystem.Data.Odbc.OdbcCommand,System.Data.CommandBehavior,int)
+in <0x00034> System.Data.Odbc.OdbcCommand:ExecuteReader (CommandBehavior
+behavio
+r)
+in <0x0000c> System.Data.Odbc.OdbcCommand:ExecuteReader ()
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcCommand:ExecuteRead
+er ()
+in <0x00089> Db_Access.MainClass:Main (System.String[] args)
+
+C:\Documents and Settings\Administrator\Desktop>
+
+----------------------------------------------------------------------------------------------------------------


More information about the mono-bugs mailing list