0% found this document useful (0 votes)
17 views2 pages

Student Grades Retrieval System

This document defines a C# class called "notasalumno" that handles retrieving and displaying student grade data from a SQL database. It contains methods for connecting to the database using a connection string, running queries to get student information and grades based on a student ID number, binding the results to interface elements like labels and a grid view, and displaying errors if the student is not found.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Student Grades Retrieval System

This document defines a C# class called "notasalumno" that handles retrieving and displaying student grade data from a SQL database. It contains methods for connecting to the database using a connection string, running queries to get student information and grades based on a student ID number, binding the results to interface elements like labels and a grid view, and displaying errors if the student is not found.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

using

using
using
using
using
using
using
using

System;
[Link];
[Link];
[Link];
[Link];
[Link];
[Link];
[Link];

public partial class notasalumno : [Link]


{
public string cadena = @"Data Source=ALEXPC\SQLEXPRESS;Initial Catalog=inji;Integrated
Security=True";

protected void ImageButton1_Click(object sender, ImageClickEventArgs e)


{
[Link] = true;
string NIE = [Link];
SqlConnection con = new SqlConnection(cadena);
string ade = "select * from Alumnos where [Link]='" + [Link] + "' ";
SqlDataAdapter ad = new SqlDataAdapter("select Nombre_Materia,
Periodo1,Periodo2,Periodo3,Periodo4,Nota_Final from Notas where [Link]='" + NIE + "'",
con);
DataSet ds = new DataSet();
[Link](ds, "Notas");
SqlCommand comando = new SqlCommand(ade, con);
[Link]();
SqlDataReader leer = [Link]();
[Link] = ds;
[Link]();
if ([Link]() == true)
{
[Link] = leer["Nombres"].ToString();
[Link] = leer["Apellidos"].ToString();
[Link] = leer["Grado"].ToString();
[Link] = leer["Seccion"].ToString();
[Link] = leer["Fecha_Nacimiento"].ToString();
[Link] = leer["Genero"].ToString();
[Link] = leer["Opcion"].ToString();
[Link] = leer["Encargado"].ToString();
[Link] = leer["NIE"].ToString();
}
else
{
[Link] = "Error";
[Link] = "Error";
[Link] = "Error";

[Link]
[Link]
[Link]
[Link]
[Link]
[Link]

=
=
=
=
=
=

"Error";
"Error";
"Error";
"Error";
"Error";
"Error";

[Link] = "";
[Link]();

You might also like