我这个比较少。。。也没经过什么处理,是用vb.net做的。不知道能不能帮上忙
Dim file As New FileInfo("图片路径")
Dim stream1 As Stream = file.OpenRead
Dim imagelen As Integer = file.Length
Dim imagedata(imagelen) As Byte
stream1.Read(imagedata, 0, imagelen)
Try
ds.Tables(0).Rows(0)(2) = imagedata
Dim sqlcom As New SqlClient.SqlCommandBuilder(sqlad)
sqlad.UpdateCommand = sqlcom.GetUpdateCommand
sqlad.Update(ds.Tables(0))
MessageBox.Show("成功")
Catch ex As IOException
MessageBox.Show("失败")
End Try