public void getStudentLoginData()
 {
     string error;
     DataTable dt = DataAccessLayer.showAllStudent(out error);
     if (error == null)
     {
         List<StudentLoginDetails> sld_List = new List<StudentLoginDetails>();
         DataTableReader dtr = new DataTableReader(dt);
         while (dtr.Read())
         {
             StudentLoginDetails sld = new StudentLoginDetails();
             sld.fname = dtr[1].ToString();
             sld.lname = dtr[2].ToString();
             sld.branch = dtr[3].ToString();
             sld.gender = dtr[4].ToString();
             sld.username = dtr[5].ToString();
             sld.verified = dtr[6].ToString();
             sld_List.Add(sld);
         }
         JavaScriptSerializer jss = new JavaScriptSerializer();
         Context.Response.Write(jss.Serialize(sld_List));
     }
 }
Esempio n. 2
0
        public void getStudentLoginData()
        {
            string    error;
            DataTable dt = DataAccessLayer.showAllStudent(out error);

            if (error == null)
            {
                List <StudentLoginDetails> sld_List = new List <StudentLoginDetails>();
                DataTableReader            dtr      = new DataTableReader(dt);
                while (dtr.Read())
                {
                    StudentLoginDetails sld = new StudentLoginDetails();
                    sld.fname    = dtr[1].ToString();
                    sld.lname    = dtr[2].ToString();
                    sld.branch   = dtr[3].ToString();
                    sld.gender   = dtr[4].ToString();
                    sld.username = dtr[5].ToString();
                    sld.verified = dtr[6].ToString();
                    sld_List.Add(sld);
                }
                JavaScriptSerializer jss = new JavaScriptSerializer();
                Context.Response.Write(jss.Serialize(sld_List));
            }
        }