Exemplo n.º 1
0
 protected void BindData()
 {
     try
     {
         Class1  c  = new Class1();
         DataSet ds = new DataSet();
         string  s  = "Select Student_Reg.UserID, Photo.URL, Student_Reg.FirstName, Student_Reg.MiddleName, Student_Reg.LastName from Student_Reg INNER JOIN Photo ON Student_Reg.UserID = Photo.UserID and Student_Reg.Department='" + Department.SelectedValue + "' and Student_Reg.Semester='" + Sem.SelectedValue + "'";
         ds = c.select(s);
         if (ds.Tables[0].Rows[0][0] != null)
         {
             string str = ds.Tables[0].Rows[0][0].ToString();
             AttendanceGrid.DataSource = ds;
             AttendanceGrid.DataBind();
         }
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('Error:" + ex.Message + "');</script>");
     }
 }
Exemplo n.º 2
0
 protected void OnPaging(object sender, GridViewPageEventArgs e)
 {
     BindData();
     AttendanceGrid.PageIndex = e.NewPageIndex;
     AttendanceGrid.DataBind();
 }