my db table is tbltest with id(int),name(varchar),lastname(varchar),foto(datatype image)
i can insert data in my database but i don't now to update them
i have store data in my db ,and i will to update them with a button (update)
the code for my insert button is
cmdtabela1 = connetion.CreateCommand
cmdtabela1.CommandText = "insert into tbltest values (@name,@lastname,@foto) "
cmdtabela1.Parameters.AddWithValue("name", txtname.Text)
cmdtabela1.Parameters.AddWithValue("lastname", txtlastname.Text)
Dim ms As New MemoryStream()
PictureBox1.BackgroundImage.Save(ms, PictureBox1.BackgroundImage.RawFormat)
Dim data As Byte() = ms.GetBuffer()
Dim p As New SqlParameter("foto", SqlDbType.Image)
p.Value = data
cmdtabela1.Parameters.Add(p)
now how to update this colums in my database
i have write this code for my update button
connetion = New SqlConnection("my conetion string")
connetion.Open()
Dim ms As New MemoryStream()
PictureBox3.BackgroundImage.Save(ms, PictureBox3.BackgroundImage.RawFormat)
Dim data As Byte() = ms.GetBuffer()
Dim p As New SqlParameter("Foto", SqlDbType.Image)
p.Value = data
cmdtabela.Parameters.Add(p)
cmdtabela = connetion.CreateCommand
cmdtabela.CommandText = "update tbltest set name='" & txtupdatename.Text & "', lastname='" & txtupdatelstname.Text & where Id=