public DataTable GetTabla(int id) { DataTable dt = new DataTable(); try { conexion = new UConexion(); SqlConnection con = conexion.Conexion(); using (con) { string query = "SELECT * FROM AlumCom where alu_ID = @alu_ID"; comando = new SqlCommand(query, con); comando.Parameters.Add("@alu_ID", SqlDbType.Int).Value = id; dt.Load(comando.ExecuteReader()); con.Close(); } } catch (Exception) { throw; } return(dt); }
public int ObtenerID(string matricula) { conexion = new UConexion(); SqlConnection con = conexion.Conexion(); int id = 0; using (con) { instruccion = "SELECT alu_ID from Alumno WHERE (alu_NumControl = @alu_NumControl)"; comando = new SqlCommand(instruccion, con); comando.Parameters.Add("@alu_NumControl", SqlDbType.VarChar).Value = matricula; SqlDataReader rd = comando.ExecuteReader(); if (rd.HasRows) { while (rd.Read()) { id = rd.GetInt32(0); } } conexion.Conexion().Close(); } return(id); }
public DataTable GetTabla(int id) { DataTable dt = new DataTable(); try { conexion = new UConexion(); SqlConnection con = conexion.Conexion(); using (con) { string query = "SELECT * FROM Alumno INNER JOIN Especialidades ON Alumno.esp_ID=Especialidades.esp_ID "; query += "WHERE alu_ID = @alu_ID"; comando = new SqlCommand(query, con); comando.Parameters.Add("@alu_ID", SqlDbType.Int).Value = id; dt.Load(comando.ExecuteReader()); con.Close(); } } catch (Exception) { throw; } return dt; }
public void InsertEsc(AlumComDTO obj, int id) { conexion = new UConexion(); using (conexion.Conexion()) { int x = 0; comando = new SqlCommand(); instruccion = "INSERT INTO AlumCom (alc_PromBachi,alc_AnioTerminoBachi,mun_Escue_ID,est_Escue_ID,esc_ID,alc_EspBachill, alu_ID) VALUES "; instruccion += "(@alc_PromBachi,@alc_AnioTerminoBachi,@mun_Escue_ID,@est_Escue_ID,@esc_ID,@alc_EspBachill, @alu_ID) "; comando = new SqlCommand(instruccion, conexion.Conexion()); comando.Parameters.Add("@alc_PromBachi", SqlDbType.VarChar).Value = obj.alc_PromBachi; comando.Parameters.Add("@alc_EspBachill", SqlDbType.VarChar).Value = obj.alc_EspBachill; comando.Parameters.Add("@mun_Escue_ID", SqlDbType.Int).Value = obj.mun_Escue_ID; comando.Parameters.Add("@est_Escue_ID", SqlDbType.Int).Value = obj.est_Escue_ID; comando.Parameters.Add("@esc_ID", SqlDbType.Int).Value = obj.esc_ID; comando.Parameters.Add("@alc_AnioTerminoBachi", SqlDbType.VarChar).Value = obj.alc_AnioTerminoBachi; comando.Parameters.Add("@alu_ID", SqlDbType.Int).Value = id; x = comando.ExecuteNonQuery(); } }
public ViviendaDAOSQL() { c = new UConexion(); }
public FacadeAspirante(IAspirante a) { con = new UConexion(); this.a = a; }
public LogInDAOSQL() { c = new UConexion(); }
public IngrEgrFamiliaresDAOSQL() { c = new UConexion(); }
public AntecedentesAluQL() { c = new UConexion(); }
public BecasDAOSQL() { c = new UConexion(); }
public EncuestasDAO() { c = new UConexion(); }