hi. how can i save image file in mySQL from vb.net?
my vb.net program picture
the image i want to save in mySQL database is already in the picture box
mySQL table
and this is my SQL tables now how can i add the image in the picture box to mySQL

"Insert into brgyemployee (PICTURE) values ('"PictureBox1.Image"')"

dont work :(

note: brgyemployee is the name of my table where "PICTURE" column is located

Edited by frotek: tags

5 Years
Discussion Span
Last Post by frotek

or atleast to fix this code

Imports MySql.Data.MySqlClient
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim con As New MySqlConnection()
        Dim cmd As New MySqlCommand
        Dim adptr As New MySqlDataAdapter
        Dim table As Image
        con.ConnectionString = "SERVER=localhost;UID=root;PWD=israel;DATABASE=testing"
        adptr = New MySqlDataAdapter("SELECT PICTURE FROM brgyemployee WHERE Fname= '" & TextBox1.Text & "'", con)
        Dim i As Integer
        PictureBox1.Image = [U]PictureBox1.Image & ""[/U] & [U]table.Rows[/U](i)("PICTURE")
    End Sub
End Class

underlined codes gives me errors, this one is for loading the image from database in

Edited by frotek: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.