2012-06-01 5 views
1

DataGrid에서 데이터를 바인딩하기위한 간단한 wpf 응용 프로그램을 작성했습니다. 다음 줄에서 실행하는 동안 오류가 발생합니다.wpf 응용 프로그램에서 호출 대상에 의해 예외가 발생했습니다.

string ConString = System.Configuration.ConfigurationManager 
         .ConnectionStrings["ConString"].ToString(); 

예외 보여준다 Exception has been thrown by the target of an invocation."

InnerException:{"Object reference not set to an instance of an object."}

+0

응용 프로그램에서이 라인을 호출하는 시점은 언제입니까? ConfigurationManager의 값을 확인하면 null입니까? – Andy

+0

나는 그것을 FillDatagrid() 메서드로 작성했습니다 – Shipu

+0

이 예외에 대한 콜 스택을 제공해 주시겠습니까? –

답변

1

아마 System.Configuration.ConfigurationManager.ConnectionStrings [ "ConString은"] NULL이거나 System.Configuration.ConfigurationManager.ConnectionStrings는 NULL이다.

+1

app.config 파일 : Shipu

+0

왜 이것이 올 것입니까? 여전히 찾을 수 없습니다. – Shipu

관련 문제