[Mono-dev] how can I connect to oracle10g ?

yuehuaqi yuehuaqi at 163.com
Mon Jul 30 04:42:03 EDT 2007


hi:
I use these code to connect to oracle on ubuntu 7.04 and mono 1.2.4
----------------------
  public static void Main (string[] args)
  {
   try{    
    System.Data.OracleClient.OracleConnection con = new System.Data.OracleClient.OracleConnection();
    con.ConnectionString ="Data Source=huaxe;User ID=wordlibrary;Password=hello";
    con.Open();
    con.Close();
    
   }catch(Exception ex){ 
    Console.WriteLine("error:" + ex.StackTrace);
    Exception e = ex.InnerException;
    while(e != null){
     Console.WriteLine("inner :" + e.Message);
     e = e.InnerException;
    }
   }
  }
----------------------
then it output this error message:


error:  at (wrapper managed-to-native) OciNativeCalls:OCIEnvCreate (intptr&,System.Data.OracleClient.Oci.OciEnvironmentMode,intptr,intptr,intptr,intptr,int,intptr)
  at System.Data.OracleClient.Oci.OciCalls.OCIEnvCreate (System.IntPtr& envhpp, OciEnvironmentMode mode, IntPtr ctxp, IntPtr malocfp, IntPtr ralocfp, IntPtr mfreep, Int32 xtramem_sz, IntPtr usrmempp) [0x00000] in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs:721 
  at System.Data.OracleClient.Oci.OciEnvironmentHandle..ctor (OciEnvironmentMode mode) [0x00000] 
  at System.Data.OracleClient.Oci.OciGlue.CreateConnection (OracleConnectionInfo conInfo) [0x00000] in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OciGlue.cs:86 
  at System.Data.OracleClient.OracleConnectionPoolManager.CreateConnection (OracleConnectionInfo info) [0x00006] in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleConnectionPoolManager.cs:57 
  at System.Data.OracleClient.OracleConnectionPool.CreateConnection () [0x0000e] in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleConnectionPool.cs:97 
  at System.Data.OracleClient.OracleConnectionPool.GetConnection () [0x000bb] in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleConnectionPool.cs:74 
  at System.Data.OracleClient.OracleConnection.Open () [0x00061] in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleConnection.cs:352 
  at (wrapper remoting-invoke-with-check) System.Data.OracleClient.OracleConnection:Open ()
  at databaseDemo.MainClass.Main (System.String[] args) [0x00011] in /home/yuehuaqi/projects/mono/databaseDemo/databaseDemo/Main.cs:23 
------------------------------
who can tell me why ? 
btw: I had install oracle 10g client successed.

thanks a lot. ^_^
This is my first mail.






yuehuaqi
2007-07-30
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070730/a9526193/attachment.html 


More information about the Mono-devel-list mailing list