เวลากดบันทึกแล้วบันทึกภาพลงฐานข้อมูลไม่ได้ครับ
sql = "insert into product values('@proid','@proname','@protypename','@pbname','@pcolorname','@psizename','{@pbed}',
'{@pprice}','{@pstock}','@pstatus','@ppicname',@ppic)"
cmd = New SqlClient.SqlCommand(sql, cn)
cmd.Parameters.Clear()
cmd.Parameters.AddWithValue("proid", txt_proid.Text)
cmd.Parameters.AddWithValue("proname", txt_proname.Text)
cmd.Parameters.AddWithValue("protypename", btn_bname.Text)
cmd.Parameters.AddWithValue("pbname", btn_bname.Text)
cmd.Parameters.AddWithValue("pcolorname", btn_colorname.Text)
cmd.Parameters.AddWithValue("psizename", btn_sizename.Text)
cmd.Parameters.AddWithValue("pbed", txt_pbed.Text)
cmd.Parameters.AddWithValue("pprice", txt_pprice.Text)
cmd.Parameters.AddWithValue("pstock", txt_pstock.Text)
cmd.Parameters.AddWithValue("pstatus", btn_status.Text)
cmd.Parameters.AddWithValue("ppicname", txt_pictuername.Text)
cmd.Parameters.AddWithValue("ppic", picture)
If cmd_excuteNonquery() = 0 Then
MsgBox("เพิ่มข้อมูลไม่สำเร็จ")
Else
MsgBox("เพิ่มข้อมูลสำเร็จ")
txt_proid.Text = ""
txt_proname.Text = ""
refresh_product()
End If
บันทึกรูปภาพลงฐานข้อมูลไม่ได้ครับ ช่วยทีครับ
sql = "insert into product values('@proid','@proname','@protypename','@pbname','@pcolorname','@psizename','{@pbed}',
'{@pprice}','{@pstock}','@pstatus','@ppicname',@ppic)"
cmd = New SqlClient.SqlCommand(sql, cn)
cmd.Parameters.Clear()
cmd.Parameters.AddWithValue("proid", txt_proid.Text)
cmd.Parameters.AddWithValue("proname", txt_proname.Text)
cmd.Parameters.AddWithValue("protypename", btn_bname.Text)
cmd.Parameters.AddWithValue("pbname", btn_bname.Text)
cmd.Parameters.AddWithValue("pcolorname", btn_colorname.Text)
cmd.Parameters.AddWithValue("psizename", btn_sizename.Text)
cmd.Parameters.AddWithValue("pbed", txt_pbed.Text)
cmd.Parameters.AddWithValue("pprice", txt_pprice.Text)
cmd.Parameters.AddWithValue("pstock", txt_pstock.Text)
cmd.Parameters.AddWithValue("pstatus", btn_status.Text)
cmd.Parameters.AddWithValue("ppicname", txt_pictuername.Text)
cmd.Parameters.AddWithValue("ppic", picture)
If cmd_excuteNonquery() = 0 Then
MsgBox("เพิ่มข้อมูลไม่สำเร็จ")
Else
MsgBox("เพิ่มข้อมูลสำเร็จ")
txt_proid.Text = ""
txt_proname.Text = ""
refresh_product()
End If