[Mono-bugs] [Bug 59939][Maj] Changed - OracleConnection:Open throth unhandled exection on Mac OS X 10.3.4

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 12 Jun 2004 05:33:47 -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-12 05:15:09.000000000 -0400
+++ shadow/59939.tmp.21207	2004-06-12 05:33:47.000000000 -0400
@@ -3326,6 +3326,49 @@
 Doing so "<dllmap dll="oci" target="libclntsh.dylib" />" ... the execption changed:
 
 Unhandled Exception: System.InvalidCastException: Cannot cast from source type to 
 destination type.
 in <0x00138> Test:Main (string[])
 
+
+------- Additional Comments From dieter@fiebelkorn.net  2004-06-12 05:33 -------
+Happened on "string employeeName = (string) reader["mdname"];"  ????? ?????
+
+=======================================================
+ 
+ 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=xxxxx;" + 
+     "Password=xxxxx;"; 
+  OracleConnection dbcon = null; 
+  dbcon = new OracleConnection (connectionString); 
+  dbcon.Open (); 
+  OracleCommand dbcmd = dbcon.CreateCommand (); 
+  string sql = "SELECT mdname, mdid FROM mdpatient"; 
+  dbcmd.CommandText = sql; 
+  OracleDataReader reader = dbcmd.ExecuteReader (); 
+  while (reader.Read ()) { 
+     string employeeName = (string) reader["mdname"]; // <= HERE 
+     string job = (string) reader["mdid"]; 
+     Console.WriteLine ("Employee Name: {0}  Job: {1}", 
+      employeeName, job); 
+  } 
+  // clean up 
+  reader.Close (); 
+  reader = null; 
+  dbcmd.CommandText = sql; 
+  dbcmd.ExecuteNonQuery (); 
+  dbcmd.Dispose (); 
+  dbcmd = null; 
+  dbcon.Close (); 
+  dbcon = null; 
+    } 
+ } 
+