oledbexeception未处理标准表达式中的数据类型不匹配

时间:2014-12-09 05:13:32

标签: vb.net

您好我在acscmd.executenonquery()上遇到问题

你可以给我一个解决方案吗

 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Dim fsreader As New FileStream(OpenFileDialog1.FileName, FileMode.Open, FileAccess.Read)

    Dim breader As New BinaryReader(fsreader)
    Dim imgbuffer(fsreader.length) As Byte
    breader.Read(imgbuffer, 0, fsreader.length)
    fsreader.Close()

    strsql = "insert into tablepict (name,picture) values (@dtaname, @dtapic)"

    acscmd.CommandText = strsql
    acscmd.Connection = acsconn
    acscmd.Parameters.AddWithValue("@dtaname", TextBox1.Text)
    acscmd.Parameters.AddWithValue("@dtapic", imgbuffer)
    acscmd.ExecuteNonQuery()
    acscmd.Dispose()
    MsgBox("saved")
End Sub

0 个答案:

没有答案