Bug #5624 | mysqlparameter not working for blob fields | ||
---|---|---|---|
Submitted: | 17 Sep 2004 5:08 | Modified: | 17 Sep 2004 16:47 |
Reporter: | Nate Jones | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 1.0.0 Beta | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[17 Sep 2004 5:08]
Nate Jones
[17 Sep 2004 14:26]
Svetoslav Milenov
This is not a bug. You have 2 errors in your code: 1. your command is SqlClient.SqlCommand, while it should be MySqlClinet.MySqlCommand 2. The parameter escape character in MySql is "?", not "@". This works: MySqlConnection con = new MySqlConnection("xxxxx"); MySqlCommand com = new MySqlCommand("INSERT INTO test.pictest (pictest.PicArray, pictest.PicID) VALUES (?picarray, ?picid)", con); byte[] picarray = new byte[1000]; picarray.Initialize(); com.Parameters.Add("?picarray", picarray); com.Parameters.Add("?picid", 1); con.Open(); com.ExecuteNonQuery(); con.Close(); Cheers
[17 Sep 2004 16:27]
Nate Jones
Ok, It's working now that I changed the escape Parameters over to using the '?' instead of the '@'. Thanks Svetoslav!! btw, the sqlclient.sqlcommand, was just a typo in here. I had it the right way in my code, thanks!!
[17 Sep 2004 16:47]
MySQL Verification Team
According your last post.