Can anyone give me an example of how t开发者_StackOverflow中文版o 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.
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.
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/
精彩评论