hi to all, can you help me in my program, i can't retrieve my image in the database to vb.net
how can i view my image when i click in listview? plss help me
THIS IS MY CODE HOPE YOU CAN HELP ME!
Imports MySql.Data.MySqlClient
Public Class Often_Motorcycle_Problems
Public ConnString As String = "server=localhost;user id=root;password=;database=motorcycle"
Public CONNECTION As New MySqlConnection(ConnString)
Public ds As New DataSet
Public strSQL As String
Public cmd As New MySqlCommand
Public dr As MySqlDataReader
Dim a, b, c, d, e, f, g
Private Sub ListView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick
If ListView1.Items.Count > 0 Then
Motorcycle_Information.lblno.Text = ListView1.SelectedItems(0).Text
Motorcycle_Information.lblskinname.Text = ListView1.SelectedItems(0).SubItems(1).Text
Motorcycle_Information.lbllevel.Text = ListView1.SelectedItems(0).SubItems(2).Text
strSQL = "SELECT * from motorproblem where id= '" & ListView1.SelectedItems(0).Text & "'"
CONNECTION.Open()
cmd = New MySqlCommand(strSQL, CONNECTION)
dr = cmd.ExecuteReader()
ListView1.Items.Clear()
Do While dr.Read()
d = (dr.Item("description").ToString())
g = (dr.Item("cause").ToString())
Motorcycle_Information.lbldesc.Text = d
Motorcycle_Information.lblcause.Text = g
Loop
dr.Close()
CONNECTION.Close()
cmd.Dispose()
End If
Motorcycle_Information.Show()
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
End Sub
Private Sub Often_Motorcycle_Problems_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Txtsearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtsearch.TextChanged
strSQL = "SELECT * from motorproblem where partsname like '%" & Txtsearch.Text & "%'"
CONNECTION.Open()
cmd = New MySqlCommand(strSQL, CONNECTION)
dr = cmd.ExecuteReader()
ListView1.Items.Clear()
Do While dr.Read()
a = (dr.Item("id").ToString())
b = (dr.Item("partsname").ToString())
c = (dr.Item("level").ToString())
Dim lv As ListViewItem = ListView1.Items.Add(a)
lv.SubItems.Add(b)
lv.SubItems.Add(c)
Loop
dr.Close()
CONNECTION.Close()
cmd.Dispose()
End Sub