update
Me.PictTableAdapter.UpdateQuery(TextBox7.Text, TextBox8.Text, TextBox9.Text, TextBox10.Text, TextBox11.Text, TextBox12.Text, ComboBox1.Text)
Me.PictTableAdapter.Fill(Me.PictureDataSet.pict)
save (the saving command using the picture save)
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Then
MsgBox("plz fill the field")
Else
Dim ms As New MemoryStream
Dim path() As String = Split(TextBox3.Text, "\")
Array.Reverse(path)
PictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat)
Dim img() As Byte = ms.GetBuffer
ms.Close()
Me.PictTableAdapter.InsertQuery(TextBox1.Text, img, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text)
Try
MsgBox("saved", MsgBoxStyle.OkOnly, "Spares")
Me.PictTableAdapter.Fill(Me.PictureDataSet.pict)
TextBox1.Text = TextBox1.Text + 1
PictureBox1.ImageLocation = TextBox3.Text
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
Catch ex As Exception
MsgBox("Error", MsgBoxStyle.OkOnly, "Spares")
End Try
End If
delete
Me.PictTableAdapter.DeleteQuery(ComboBox1.Text)
Me.PictTableAdapter.Fill(Me.PictureDataSet.pict)
picture-databasename
pict-tablename