Home All Groups Group Topic Archive Search About

Insert a byte() or hexadecimal data to mySQL..

Author
23 Nov 2005 12:17 AM
den 2005
Hi everybody,

How do you insert to a column of a table with a blob or binary datatype if
there is one, from a byte() datatype? What is wrong? How can I fixed this? I
need help. Thanks.

Note: The data is in byte() or hexadecimal to be inserted into a column in
mySQL table.

Code:
string sqlText = "Insert table1(id, dataByte) values('" + id + "'," +
byteData + ")";

OdbcCommand cmd = new OdbcCommand(sqlText, odConn);

//opening connection here

int iRes = cmd.ExecuteNonQuery();

Result:
iRes = -1

I used Text datatype by converting bytes() to hexadecimal, it returns -1,
also. The hexadecimal is too long for statement to be executed. How can I
solved this? Is Anyone who can help me? Thanks.



denpsia
--
MCP Year 2005, Philippines

AddThis Social Bookmark Button