Dim colname As String = DataGridView1.Columns(e.ColumnIndex).Name If colname = "colEdit" Then With frmProudctM cn.Open() cm = New MySqlCommand("select image, pid, description, category, costprice, sellingprice from tblproduct where pid like '" & DataGridView1.Rows(e.RowIndex).Cells(1).Value & " ' ", cn) dr = cm.ExecuteReader() While dr.Read Dim len As Long = dr.GetBytes(0, 0, Nothing, 0, 0) Dim arr(CInt(len)) As Byte dr.GetBytes(0, 0, arr, 0, CInt(len)) Dim MS As New MemoryStream(arr) Dim Bitmap As New Bitmap(MS) .PictureBox1.Image = Bitmap .lblpid.Text = dr.Item("pid").ToString .txtDescription.Text = dr.Item("description").ToString .cboCategory.Text = dr.Item("category").ToString .txtCostPrice.Text = dr.Item("costprice").ToString .txtSellingPrice.Text = dr.Item("sellingprice").ToString End While dr.Dispose() cn.Close() .btnSubmit.Visible = False .btnUpdate.Visible = True .ShowDialog() End With
"select image, pid, description, category, costprice, sellingprice from tblproduct where pid like '" & DataGridView1.Rows(e.RowIndex).Cells(1).Value & " ' "
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)