arshafieen
New member
- Joined
- May 16, 2013
- Messages
- 3
- Programming Experience
- Beginner
I've tried using this code but don't what wrong with this code..
My Coding
Private Sub lblsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblsave.Click
con.Open()
str = "update cpkStaff set Image = @myimage where StaffID = @id"
With cmd.Parameters
Try
Dim ms As New System.IO.MemoryStream
Dim bmpImage As New Bitmap(PictureBox1.Image)
bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
bytImage = ms.ToArray()
ms.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
.AddWithValue("@myimage", bytImage)
.AddWithValue("@id", cpk2main.txtid.Text)
End With
cmd = New SqlCommand(str, con)
cmd.ExecuteNonQuery()
MessageBox.Show("Admin's account was successfully updated!", "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information)
con.Close()
End Sub
PROBLEM


Some can help solve this problem.. i need it coz next month i've presentation
My Coding
Private Sub lblsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblsave.Click
con.Open()
str = "update cpkStaff set Image = @myimage where StaffID = @id"
With cmd.Parameters
Try
Dim ms As New System.IO.MemoryStream
Dim bmpImage As New Bitmap(PictureBox1.Image)
bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
bytImage = ms.ToArray()
ms.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
.AddWithValue("@myimage", bytImage)
.AddWithValue("@id", cpk2main.txtid.Text)
End With
cmd = New SqlCommand(str, con)
cmd.ExecuteNonQuery()
MessageBox.Show("Admin's account was successfully updated!", "INFO", MessageBoxButtons.OK, MessageBoxIcon.Information)
con.Close()
End Sub
PROBLEM


Some can help solve this problem.. i need it coz next month i've presentation