在这里遇到一个小问题,不知道代码哪里错了
Private Sub SimpleButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton1.Click
Dim str As New MemoryStream
Dim Serializetemplate As New DPFP.Template
Serializetemplate.Serialize(str)
Dim serializedTemplate As Byte() = str.ToArray()
'save to database
opencon1()
Dim cmd As MySql.Data.MySqlClient.MySqlCommand
cmd = New MySql.Data.MySqlClient.MySqlCommand
cmd.Parameters.AddWithValue("?imagedata", serializedTemplate)
cmd.Parameters.AddWithValue("?userid", txtEmpid.Text)
cmd.CommandText = "UPDATE master SET fp1=?imagedata WHERE userid=?userid"
cmd.CommandType = CommandType.Text
cmd.Connection = con1
cmd.ExecuteNonQuery()
End Sub
我在Serializetemplate.Serialize(str)处收到错误消息,错误消息为 Bad Serialization
有人遇到过这个错误并解决它吗?