I want to show only some of the fields that I bring from my query, but when viewing them, they all appear in the grid
List<Pojos.agregarProducto> lstProd = new List<Pojos.agregarProducto>();
MySqlDataReader dr;
MySqlCommand cm = new MySqlCommand("select nombres,cantidad,precio,total" +
" from venta_Producto where idVenta =" + id, cn.Conectar());
dr = cm.ExecuteReader();
while (dr.Read())
{
Pojos.agregarProducto objAp = new Pojos.agregarProducto();
objAp.Nombres = dr.GetString("nombres");
objAp.Cantidad = dr.GetDouble("cantidad");
objAp.Precio = dr.GetDouble("precio");
objAp.Total = dr.GetDouble("total");
lstProd.Add(objAp);
}
cn.Cerrar();
return lstProd;
}