0

I am currently trying to display data from a table in a MySQL Database using a DataGrid component in ASP.net C#.

Its displaying all of the columns which are in int and varchar format but one column is a mediumblob format which contains only text.

I am binding the DataGrid to a DataSet from the MySQL table using the following

public void loadGrid(string query, GridView tblGrid)
    {
        using (DatabaseWork db = new DatabaseWork())
        {
            using (MySqlCommand cmd = new MySqlCommand(query, db.conn))
            {
                using (MySqlDataAdapter da = new MySqlDataAdapter(cmd))
                {

                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    tblGrid.DataSource = ds.Tables[0];
                    tblGrid.DataBind();
                }

            }
        }

For some reason the Medium blob is never being shown and no exception is being thrown.

Thanks for any help you can offer.

2 Answers 2

1

You'll need to process the BLOB first. For a bit of help, have a look here: http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-blob.html

Sign up to request clarification or add additional context in comments.

Comments

0

@Francis Gilbert. Looking at the post I thought it would make more sense as I am only going to be storing text in the field is to the field TINYTEXT instead of TINYBLOB. Doing this fixes the datagrid.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.