Dim n As Integer = e.Form.Controls("TextBox1").value
Dim cmd As new SQLCommand
cmd.connectionName = "ImproveSQL"
cmd.commandtext = "selec t
改善前照片 from
{" & dtname & "} where 序号 ='"& n & "'"
Dim dt As DataTable = cmd.Executereader
Dim src As String
If dt.DataRows.count>0 Then
Dim imagebytes As Byte() =dt.DataRows(0)("改善前照片")
Dim ms As new system.io.memorystream(imagebytes)
e.Form.Controls("PictureBox1").image = system.drawing.image.fromstream(ms)
End If
End If
老师, 现在有照片的情况下, 我可以读取照片,但是 如果我 这一行没有照片, 他就会出错 (无法将类型为“system.Int32”的对象强制转换为类型"system.Byte[]"