public Persona getPersona(string p_cedula) { Persona res = new Persona(); string sql = "SELECT cedula, nombre, tipo FROM tpersonas WHERE cedula like '" + p_cedula + "%'"; try { con.Conectar(); OdbcDataReader dr = new OdbcCommand(sql, con.getConexion()).ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { res.Cedula = dr.GetString(0); res.Nombre = dr.GetString(1); res.Tipo = dr.GetInt16(2); } } } catch { res = null; } con.Desconectar(); return(res); }