When databinding my gridview from data stored in my database I am seeing a small square appear instead of the expected gridview results.

Image of unexpected result

The code I'm using:


               DataTable dsDetalle = new DataTable("Data");
            using (MySqlCommand commandSql = cn.CreateCommand())
                commandSql.CommandType = CommandType.Text;
                commandSql.CommandText = "select * from detalle where iddetalle=@iddetalle and idlocal=@idlocal";
                commandSql.Parameters.AddWithValue("@iddetalle", "txt_boleta.Text");
                commandSql.Parameters.AddWithValue("@idlocal", "txtlocal.Text");
                MySqlDataAdapter sqlAdapter = new  MySqlDataAdapter(commandSql);
            GridView1.DataSource = dsDetalle;
        catch (Exception ex)

            lblerror.Text = ex.ToString();

Related posts

Recent Viewed