2010-12-20 3 views
1

실행 후 ShowDialog를()에 충돌하지만, 일련의 특정 이벤트는 문제는 호출 한 후 오는 AccessViolationExceptionC# 애플리케이션 내가 액세스 데이터베이스에 연결 교류 # 프로젝트에 노력하고있다는 OleDbConnection

와 충돌을 일으 킵니다 savefiledialog가 아닌 별도의 형식으로 oledb를 사용하는 데이터베이스 연결 및 savefiledialog1.ShowDialog()

참고 : 이것은 열린 파일 대화 상자에도 적용됩니다.

+0

당신이이 문제를 봤나요? 나는 좋은 결과를 얻는다 : http://www.google.de/search?source=ig&hl=de&rlz=&=&q=AccessViolationException+connection+dialog&btnG=Google-Suche&aq=f&oq= –

+0

그래,하지만 그건 내 도움이 안된다. 발행물. – Paul

답변

0

은 다음과 같은 것을 시도

에서 System.data.dll

에서 System.Data.OleDb를 사용하고 있는지 확인하십시오 :

using (OleDbConnection connection = new OleDbConnection(connectionString)) 
    { 
     // Declare Command 
     OleDbCommand command = new OleDbCommand(YourSQL); 

     // Set the Connection to the new OleDbConnection. 
     command.Connection = connection; 

     // Open the connection and execute the command. 
     try 
     { 
      connection.Open(); 
      command.ExecuteNonQuery(); 
     } 
     catch (Exception ex) 
     { 
      Console.WriteLine(ex.Message); 
     } 
     // The connection is automatically closed when the 
     // code exits the using block. 
    } 
+0

오류는 연결에 의해 발생하지 않고 ShowDialog() 함수에 의해 throw됩니다. – Paul

+0

그래,하지만 ShowDialog가 실패하게하는 외부가 있어야하기 때문에 같은 예제를 사용 해보길 바란다. –

관련 문제