INSERT BINARY DATA IN MYSQL

May 3 2004 9:21 AM
I've tried both odbc and MySQLDriversCS from SourceForge, but none of them works properly. odbc insert nothing into the field, and MySQLDriverCS insert "System.Byte[]" string into the field. code: stream = new FileStream(control.Text, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); bReader = new BinaryReader(stream); MySQLParameter par = new MySQLParameter("@fieldname", System.Data.DbType.Binary); par.Value = bReader.ReadBytes((int)stream.Length); command.Parameters.Add(par); then is the query like: INSERT INTO TableName (filedname) VALUES (@fieldName) but it does not work, why?

Answers (1)