protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            try
            {
                string query = @"SELECT [s_name]
      ,[f_name]
      ,[m_name]
      ,[pre_addr]
      ,[par_addr]
      ,[postoffice]
      ,[postalcode]
      ,[dateofbirth]
      ,[f_phoneno]
      ,[m_phoneno]
      ,[dist]
      ,[nationality]
      ,[student_id]
      ,[pass]
      ,[class]
      ,[section]
  FROM [dbo].[student_data] where [student_id] = '" + studentid.Text + "' or [student_name] = '" + studentid.Text + "' and [class] ='" + class_.SelectedItem.Value + "' and [section] = '" + section.SelectedItem.Value + "' ";

                student_details.DataSource = dc.GetData(query);
                student_details.DataBind();
            }

            catch (SqlException ex)
            {
            }
        }
        public void noticegrid()
        {
            dataconnection dc = new dataconnection();

            string query = @"SELECT [notice]
  FROM [dbo].[notice]";

            notice.DataSource = dc.GetData(query);
            notice.DataBind();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"SELECT [sub_name]
  FROM [dbo].[subjects] where class = '" + insertid.Text + "'";

            subjects.DataSource = dc.GetData(query);
            subjects.DataBind();
        }
        protected void teacher_button_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            string query = @"SELECT [t_name]
      ,[qualification]
      ,[cgpa]
      ,[teacher_id]
      ,[t_addr]
      ,[teacher_post]
      ,[post_type]
  FROM [dbo].[teacher_data]";

            teacher.DataSource = dc.GetData(query);
            teacher.DataBind();
        }
Example #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            dataconnection dc = new dataconnection();

            try
            {
                string query = @"SELECT [class]
      ,[classtest_one]
      ,[classtest_two]
      ,[classtest_three]
      ,[mid_exam]
      ,[final_exam]
      ,[sub_name]
  FROM [dbo].[students_mark] where [student_id] = '" + student_id.Text + "' and [section] = '" + section.SelectedItem.Value + "' and [class] ='" + class_.SelectedItem.Value + "'";

                student_result.DataSource = dc.GetData(query);
                student_result.DataBind();
            }

            catch
            {
                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "result Not Found" + "');", true);
            }
        }