1

Can anyone give me an example of how to use BLOB in MySQL?

For example, how to insert value into a table if the data type is declared as BLOB.

This is for an audio file.

2 Answers 2

1

Just an example how to get a BLOB:

private byte[] GetBlob(MySqlDataReader rd, string field, Int32 len)
{
    byte[] ret = new byte[len];
    if (len > 0) rd.GetBytes(rd.GetOrdinal(field), 0, ret, 0, len);
    return ret;
}

To insert an audio file you could use byte[] f=File.ReadAllBytes() and then use f as parameter in an insert command.

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

Comments

0

you may want to have a look here: http://aspalliance.com/1093_Serialization_in_Database.all

also - as a side note, this site may help you as well: http://www.netmanners.com/email-etiquette/email-etiquette-101/

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.