Insert BLOB or generic byte[] values into database
Posted by: Diego Guidi
Date: January 27, 2005 10:07AM

I would insert binary data in my MySQL database using .NET connector 1.03.

I have created this command:
commandString = "INSERT INTO " + tableName +
" VALUES (0, PointFromWKB(?p1)";
command = new MySqlCommand(commandString, conn);
byte[] temp = CreatePointBlob(pointsX, pointsY); // Create byte[] data to insert
command.Parameters.Add("p1", temp);
command.ExecuteNonQuery();

This command generate:
MySql.Data.MySqlClient.MySqlException: #42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1


Any suggestions?

Thanks :)

Options: ReplyQuote


Subject
Written By
Posted
Insert BLOB or generic byte[] values into database
January 27, 2005 10:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.