Private Sub Picturebtt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Picturebtt.Click
With OpenFileDialog <===== มันติดตรงนี้
.Filter = "Image Files(*.gif;*.jpg) | *.gif;*.jpg"
.FileName = ""
If (.ShowDialog() = DialogResult.OK) Then
Picturetxt.Text = .FileName
End If
End With
End Sub
Private Sub Addbtt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Addbtt.Click Dim fiStream As New FileStream(Picturetxt.text, FileMode.Open, FileAccess.Read)
Dim sql As String = "INSERT INTO EmpProfile(IdNumber, EmpPic) " & _
"VALUES(@idn, @epic) "
Dim binReader As New BinaryReader(fiStream)
Dim pic() As Byte = binReader.ReadBytes(fiStream.Length)
cmd.parameters.AddWithValue("pic", EmpPic)
end sub