Example #1
0
        public void BindStudentData(int StudentId)
        {
            using (SqlCommand cmd = new SqlCommand("FetchStudentData", db.DbConnect()))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@id", StudentId);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    StudentImage.ImageUrl   = rdr["avatar"].ToString();
                    StudentDeptName.Text    = student.FetchStudentNameById(rdr["dept_id"].ToString());
                    lblStudentFullName.Text = rdr["first_name"].ToString() + " " + rdr["last_name"].ToString();
                    StudentSem.Text         = rdr["sem_id"].ToString();
                }
            }
        }
Example #2
0
        public string FetchStudentNameById(string StudentId)
        {
            int StudIdInt = Convert.ToInt16(StudentId);

            return(student.FetchStudentNameById(StudIdInt));
        }