解决方案 »

  1.   

    项目是用SVN管理的,别人没问题,就我有问题,一读取数据库在con.open的时候就报错
      

  2.   

    可能是你用的连接程序版本不兼容(MySQL Oracle)。换一个试试看。
      

  3.   

    未处理 System.AccessViolationException
      HResult=-2147467261
      Message=尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
      Source=System.Data
      StackTrace:
           在 SNINativeMethodWrapper.SNIClose(IntPtr pConn)
           在 System.Data.SqlClient.SNIHandle.ReleaseHandle()
           在 System.Runtime.InteropServices.SafeHandle.InternalDispose()
           在 System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
           在 System.Runtime.InteropServices.SafeHandle.Dispose()
           在 System.Data.SqlClient.TdsParserStateObject.Dispose()
           在 System.Data.SqlClient.TdsParser.Disconnect()
           在 System.Data.SqlClient.SqlInternalConnectionTds.LoginFailure()
           在 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
           在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
           在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
           在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
           在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
           在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
           在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
           在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
           在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
           在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
           在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
           在 System.Data.SqlClient.SqlConnection.Open()
           在 Maticsoft.DBUtility.DbHelperSQL.PrepareCommand(SqlCommand cmd, SqlConnection conn, SqlTransaction trans, String cmdText, SqlParameter[] cmdParms) 位置 F:\project\VGS2.0_通用版\DBUtility\DbHelperSQL.cs:行号 939
           在 Maticsoft.DBUtility.DbHelperSQL.Query(String SQLString, SqlParameter[] cmdParms) 位置 F:\project\VGS2.0_通用版\DBUtility\DbHelperSQL.cs:行号 917
           在 VGSStandard.DAL.SysUser.GetModel(String username, String pwdMd5) 位置 F:\project\VGS2.0_通用版\DAL\SysUser.cs:行号 483
           在 VGSStandard.BLL.SysUser.Login(String username, String pwd) 位置 F:\project\VGS2.0_通用版\BLL\SysUser.cs:行号 208
           在 VGSStandard.Web.Login.btnLogin_Click(Object sender, EventArgs e) 位置 F:\project\VGS2.0_通用版\Web\Login.aspx.cs:行号 43
           在 System.Web.UI.WebControls.Button.OnClick(EventArgs e)
           在 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
           在 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
           在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
           在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
           在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
           在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
           在 System.Web.UI.Page.ProcessRequest()
           在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
           在 System.Web.UI.Page.ProcessRequest(HttpContext context)
           在 ASP.login_aspx.ProcessRequest(HttpContext context) 位置 c:\Users\tp\AppData\Local\Temp\Temporary ASP.NET Files\root\ecd2917e\d9897fe7\App_Web_qwuimthm.0.cs:行号 0
           在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
           在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
           在 System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error)
           在 System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
           在 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
           在 System.Web.HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
           在 System.Web.HttpRuntime.ProcessRequest(HttpWorkerRequest wr)
           在 Microsoft.VisualStudio.WebHost.Request.Process()
           在 Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
           在 Microsoft.VisualStudio.WebHost.Host.ProcessRequest(Connection conn)
           在 Microsoft.VisualStudio.WebHost.Server.OnSocketAccept(Object acceptedSocket)
           在 System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
           在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           在 System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
           在 System.Threading.ThreadPoolWorkQueue.Dispatch()
           在 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
      InnerException: 
      

  4.   

    用户代码未处理 System.AccessViolationException
      HResult=-2147467261
      Message=尝试读取或写入受保护的内存。这通常指示其他内存已损坏。
      Source=System.Data
      StackTrace:
           在 SNINativeMethodWrapper.SNIClose(IntPtr pConn)
           在 System.Data.SqlClient.SNIHandle.ReleaseHandle()
           在 System.Runtime.InteropServices.SafeHandle.InternalDispose()
           在 System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
           在 System.Runtime.InteropServices.SafeHandle.Dispose()
           在 System.Data.SqlClient.TdsParserStateObject.Dispose()
           在 System.Data.SqlClient.TdsParser.Disconnect()
           在 System.Data.SqlClient.SqlInternalConnectionTds.LoginFailure()
           在 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
           在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
           在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
           在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
           在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
           在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
           在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
           在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
           在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
           在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
           在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
           在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
           在 System.Data.SqlClient.SqlConnection.Open()
           在 Jiton.Web.Global.RefreshServers() 位置 E:\2013\12\长兴社保-安普利定制版2\长兴社保\Jiton.Web\Global.asax.cs:行号 46
           在 Jiton.Web.Global.Application_Start(Object sender, EventArgs e) 位置 E:\2013\12\长兴社保-安普利定制版2\长兴社保\Jiton.Web\Global.asax.cs:行号 31
      InnerException: