You need parentheses after the function name here:
void BindEmpData()
{
...
}
Also, you'll want to make sure you initialize the DataSet
correctly:
void BindEmpData()
{
SqlDataAdapter da = new SqlDataAdapter("select e.ENO,e.ENAME,e.JOB,e.SAL,d.DNAME form EMPLOYEE e,DEPARTMENT d where e.DNO=d.DNO",cn);
DataSet ds = new DataSet();
da.Fill(ds,"EMPLOYEE");
Repeater1.DataSource = ds.Table["EMPLOYEE"];
Repeater1.DataBind();
}
And at this point you can remove the ds
and da
class members, since they are no longer being used (they've been replaced by function variables).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…