Exemplo n.º 1
0
        public bool cargarGrid(DataGridView grid)
        {
            if (string.IsNullOrEmpty(sentencia))
            {
                mensaje = "You have fogotten define a Sql sentence";
                return(false);
            }

            conexionBD conexion = new conexionBD();

            conexion.Sentencia = sentencia;

            if (!conexion.mostrarDatos())
            {
                mensaje  = conexion.Mensaje;
                conexion = null;
                return(false);
            }
            grid.DataSource = conexion.Ds.Tables[0];
            grid.ClearSelection();
            conexion = null;
            return(true);
        }