2011-11-14 4 views
0

: 는 이름 'grdViewPersonnel'는 현재 컨텍스트에 존재하지 않는내가이 오류를 받고 있어요

public partial class frmViewPersonnel : System.Web.UI.Page 
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 
     if (!Page.IsPostBack) 
     { 

      // Declare the DataSet 
      dsPersonnel myDataSet = new dsPersonnel(); 

      // Fill the dataset with what is returned from the function 
      myDataSet = clsDataLayer.GetPersonnel(Server.MapPath("PayrollSystem_DB.mdb")); 

      // Set the DataGrid to the DataSource based on the table 
      grdViewPersonnel.DataSource = myDataSet.Tables["tblPersonnel"]; 

      // Bind the DataGrid 
      grdViewPersonnel.DataBind(); 
     } 
    } 
} 
+2

.aspx 파일에'grdViewPersonnel'라는 이름의'GridView' 개체가 있습니까? – drdwilcox

+0

@drdwilcox : 고마워, 나는 그것이 단순한 무엇인지 알았다. – Mike

답변

3

나는 내기 것이라고 오류 ISN ' 여기서 일어나는거야? 어쩌면 designer.cs 파일에 있습니까?

0

귀하의 GridView가 실제로 grdViewPersonnel으로 명명 된 경우 귀하의 코드를 검사하십시오. 아마 잘못 입력했거나 나중에 선언 한 것일 수 있습니다.

0

디자이너 페이지의 gridview가 실제로 grdViewPersonnel이라는 것을 확인 했습니까?

관련 문제