您好我在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