[Mono-bugs] [Bug 59939][Nor] Changed - OracleConnection:Open throth unhandled exection on Mac OS X 10.3.4
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 13 Jun 2004 12:05:52 -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 dieter@fiebelkorn.net.
http://bugzilla.ximian.com/show_bug.cgi?id=59939
--- shadow/59939 2004-06-13 11:31:17.000000000 -0400
+++ shadow/59939.tmp.30997 2004-06-13 12:05:52.000000000 -0400
@@ -3385,6 +3385,85 @@
On Linux the code works right. I don't understand it!
------- Additional Comments From lupus@ximian.com 2004-06-13 11:31 -------
Could you check what type reader["mdname"] is?
Add a Console.WriteLine (reader["mdname"].GetType ());
+
+------- Additional Comments From dieter@fiebelkorn.net 2004-06-13 12:05 -------
+iMac:~/Desktop dieter$ mono TestExample.exe
+Name: (Type: System.DBNull) - Id: MDNAME (Type: System.DBNull)
+Name: (Type: System.DBNull) - Id: MDNAME (Type: System.DBNull)
+Name: (Type: System.DBNull) - Id: MDNAME (Type: System.DBNull)
+Name: (Type: System.DBNull) - Id: MDNAME (Type: System.DBNull)
+Name: (Type: System.DBNull) - Id: MDNAME (Type: System.DBNull)
+
+=====
+
+iMac:~/Desktop dieter$ expand -4 TestExample.cs
+ using System;
+ using System.Data;
+ using System.Data.OracleClient;
+
+ public class Test
+ {
+ public static void Main (string[] args)
+ {
+ string connectionString =
+ "Data Source=Axxx;" +
+ "User ID=xxx;" +
+ "Password=xxx;";
+ OracleConnection dbcon = null;
+ dbcon = new OracleConnection (connectionString);
+ dbcon.Open ();
+ OracleCommand dbcmd = dbcon.CreateCommand ();
+ string sql = "SELECT 'TEST', mdname, mdid FROM mdpatient";
+ dbcmd.CommandText = sql;
+ OracleDataReader reader = dbcmd.ExecuteReader ();
+ while (reader.Read ()) {
+// string name = (string) reader["mdname"];
+// string job = (string) reader["mdid"];
+ string name = reader["mdname"].ToString();
+ string job = reader.GetName(1);
+ Console.WriteLine ("Name: {0} (Type: {1}) - Id: {2} (Type: {3})",
+ name, reader["mdname"].GetType(),
+ job, reader["mdid"].GetType());
+ }
+ // clean up
+ reader.Close ();
+ reader = null;
+ dbcmd.CommandText = sql;
+// dbcmd.ExecuteNonQuery ();
+ dbcmd.Dispose ();
+ dbcmd = null;
+ dbcon.Close ();
+ dbcon = null;
+ }
+ }
+
+=====
+
+iMac:~ dieter$ sqlplus xxx/xxx@Axxx
+
+SQL*Plus: Release 9.2.0.1.0 - Developer's Release on So Jun 13 17:35:32 2004
+
+Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
+
+
+Verbunden mit:
+Oracle9i Enterprise Edition Release 9.2.0.1.0 - Developer's Release
+With the Partitioning and Oracle Data Mining options
+
+SQL> select mdname, mdid from mdpatient;
+
+MDNAME MDID
+------------------------------ ------------
+Vorbelegung 9998FFFF
+Datensammler 9999FFFF
+Fiebelkorn F00001
+Proband F00002
+Carsten Meyer . F00003
+
+5 Zeilen ausgew?hlt.
+
+SQL>
+