打开oracle链接时 尝试读取或写入受保护的内存
云想慕尘 2010-03-13 12:30:09 // 声明一个数据库连接对象
myConn = new OracleConnection( this.connectString );
try
{
myConn.Open();//此处报异常
}
下面是异常信息:
未处理 System.AccessViolationException
Message="尝试读取或写入受保护的内存。这通常指示其他内存已损坏。"
Source="System.Data.OracleClient"
StackTrace:
在 System.Data.Common.UnsafeNativeMethods.OCIServerAttach(OciHandle srvhp, OciHandle errhp, Byte[] dblink, Int32 dblink_len, MODE mode)
在 System.Data.OracleClient.TracedNativeMethods.OCIServerAttach(OciHandle srvhp, OciHandle errhp, String dblink, Int32 dblink_len, MODE mode)
在 System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
在 System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
在 System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
在 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
在 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
在 System.Data.OracleClient.OracleConnection.Open()
在 ImgCompress.OracleExecutive.ExecuteGetreader(ISql sql) 位置 C:\Documents and Settings\Administrator\桌面\图片压缩\ImgCompress\ImgCompress\OracleExecutive.cs:行号 408
在 ImgCompress.ImgDal.FindByPage(Int32 pageSize, Int32 pageIndex) 位置 C:\Documents and Settings\Administrator\桌面\图片压缩\ImgCompress\ImgCompress\ImgDal.cs:行号 48
在 ImgCompress.MainForm.btnCompress_Click(Object sender, EventArgs e) 位置 C:\Documents and Settings\Administrator\桌面\图片压缩\ImgCompress\ImgCompress\MainForm.cs:行号 103
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 ImgCompress.Program.Main() 位置 C:\Documents and Settings\Administrator\桌面\图片压缩\ImgCompress\ImgCompress\Program.cs:行号 17
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()