我byte[]对应的mysql类型为blob,byte[]大小5000代码为:
theMySqlCommand.Parameters.Clear();
theMySqlCommand.CommandType = System.Data.CommandType.Text;
theMySqlCommand.CommandText = "insert into fingertemplate (userID, templateID, templateData) values (@userID, @templateID, @templateData);";
MySqlParameter param = new MySqlParameter("@userID", MySqlDbType.UInt32);
param.Value = infoEx.template.userID;
theMySqlCommand.Parameters.Add(param);
param = new MySqlParameter("@templateID", MySqlDbType.Int32);
param.Value = infoEx.template.templateID;
theMySqlCommand.Parameters.Add(param);
param = new MySqlParameter("@templateData", MySqlDbType.Blob);
param.Value = infoEx.template.templateData;   //为byte[]
theMySqlCommand.Parameters.Add(param);
reslut = theMySqlCommand.ExecuteNonQuery();为什么我这样操作有时能插入输入,有时又不能包sql语句错误,我的byte[]也是指纹模板信息。
报错我觉得是byte[]的内容编码引起,但不知掉如何解决。
报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' \a?w[曇?>揎q羼饙 筤.噞h逘  俛W[曇???f _垰??邾&S
 侫w[懩閨絿:]灈W堪=宙鍿 0' at line 1