[Mono-list] System.OutOfMemoryException on Solaris 8
Melissa Vandenbrink
melissa.vandenbrink at gmail.com
Tue May 23 11:32:33 EDT 2006
I am having problems with Solaris 8 / mono 1.1.15 - every once in a while
I'll get this error:
bash-3.1# mono odbcConnectTest.exe
Unhandled Exception: System.ExecutionEngineException: SIGILL
in <0x00000> <unknown method>
in <0x0000c> System.OutOfMemoryException:.ctor (System.String message)
and everyonce in awhile the program will run just fine.
the program is simple, I'm just testing my odbc connection to sybase...
using System;
using System.Data;
using System.Data.Odbc;
namespace ConnectSybaseODBC
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Connect
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
string connectionString =
"DSN=MYDSN;" +
"UID=MYUID;" +
"PWD=MYPASS;" +
"DB=MYDB";
OdbcConnection dbcon;
dbcon = new OdbcConnection(connectionString);
dbcon.Open();
set_ansinull (ref dbcon, false);
IDbCommand dbcmd = dbcon.CreateCommand();
string sql =
"SELECT name " +
"FROM master.dbo.sysobjects";
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
string objName = reader["name"].ToString();
Console.WriteLine("Name: " + objName);
}
// clean up
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbcon.Close();
dbcon = null;
}
static public void set_ansinull (ref OdbcConnection db_conn,
bool on) {
OdbcCommand cmd = new OdbcCommand (
"SET ANSINULL " + (on? "ON": "OFF"),
db_conn);
//cmd.ExecuteNonQuery();
try {
OdbcDataReader rd = cmd.ExecuteReader();
while (rd.Read());
rd.Close();
} catch ( OdbcException ){} ;
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060523/70c18a20/attachment-0001.html
More information about the Mono-list
mailing list