コード例 #1
0
 protected void btn_guardar_Click(object sender, EventArgs e)
 {
     try
     {
         string cohorte  = txt_cohorte.Value;
         string carrera  = txt_carrera.Value;
         string semestre = txt_semestre.Value;
         string grupo    = txt_grupo.Value;
         string turno    = txt_turno.Value;
         con.Open();
         string        qry = "INSERT INTO Grupos VALUES('" + cohorte + "'," + carrera + "," + semestre + "," + grupo + ",'" + turno + "')";
         SqlCommand    cmd = new SqlCommand(qry, con);
         SqlDataReader sdr = cmd.ExecuteReader();
         lbl_info.InnerText = "Grupo creado correctamente.!!";
         nota.Visible       = true;
         RepeaterGrupos.DataBind();
         con.Close();
     }
     catch (Exception ex)
     {
         lbl_info.InnerText = ex.Message;
         nota.Visible       = true;
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     nota.Visible = false;
     RepeaterGrupos.DataBind();
 }