Try Dim conn As MySqlConnection conn = New MySqlConnection() conn.ConnectionString = "server=localhost; user id=root; password=zhakige; database=Barangay_170_2" Dim myAdapter As New MySqlDataAdapter Dim sqlquery = "SELECT * FROM Residents WHERE ID= '" + lblID.Text + "'" Dim myCommand As New MySqlCommand() myCommand.Connection = conn myCommand.CommandText = sqlquery myAdapter.SelectCommand = myCommand conn.Close() conn.Open() Dim ms As New MemoryStream Dim bm As Bitmap = New Bitmap(PictureBox2.Image) bm.Save(ms, PictureBox2.Image.RawFormat) Dim arrPic() As Byte = ms.GetBuffer() sqlquery = "update Residents set Image=@Image where ID=@ID" myCommand = New MySqlCommand(sqlquery, conn) myCommand.Parameters.AddWithValue("@Image", arrPic) myCommand.ExecuteNonQuery() conn.Close() myAdapter.Fill(ds) list() Catch ex As MySqlException MessageBoxEx.Show(ex.Message) End Try
sqlquery
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)