本文介绍了这总是显示参数无效.....为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub DgvList_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DgvList.CellContentClick

    Cmd.Connection = Con

    'Dim BWriter As New IO.BinaryWriter(New IO.MemoryStream)
    Dim Img As String
    Img = DgvList.Rows(DgvList.CurrentRow.Index).Cells("DgvPID").Value.ToString
    Cmd.CommandText = "SELECT Photo FROM Hospital WHERE ID  = '" & Img & "'"

    Dim Strm As New MemoryStream
    Dim imge As Byte() = DirectCast(Cmd.ExecuteScalar, Byte())
    Strm.Write(imge, 0, imge.Length)
    Dim BM As New Bitmap(Strm)
    PicPhoto.Image = BM

End Sub

推荐答案


这篇关于这总是显示参数无效.....为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 18:07
查看更多