0
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
GetPicture()
End Sub
Public Sub GetPicture()
con.Open()
Dim dt As New DataTable("Users")
Dim rs As New OleDb.OleDbDataAdapter("Select * from Users where StudentNumber='" & TextBox1.Text & "' ", con)
rs.Fill(dt)
DataGridView1.DataSource = dt
DataGridView1.Refresh()
Label1.Text = dt.Rows.Count
rs.Dispose()
con.Close()
If Val(Label1.Text) = 1 Then
Dim i As Integer
i = DataGridView1.CurrentRow.Index
PictureBox1.Image = FixNull(DataGridView1.Item(6, i).Value)
End If
______________________________
我就行了這個錯誤:PictureBox1.Image = FixNull(DataGridView1.Item(6,I).value的)如何顯示/從Access數據庫獲取圖像到圖片框在VB
-> Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image'.
截圖: