dualshock03
Well-known member
- Joined
- Jan 28, 2007
- Messages
- 105
- Programming Experience
- 1-3
i have a dtagridview with an image column with a corresponding content click event that enables my picture box to display the image from the image item in datagrdiview.. then delete the retrieved by pressing with button..
check my attachment for viewing...
this is my code for the datagridview content click event:
However im ecountering this error = ("Unable to cast object of type 'System.Byte[]' to type 'System.IO.Stream'.") due to wrong conversion type of the image.. i dont what to do.. my brain's rolling inside my head waaahh... please help fix this.. i know its something to do with filestream... am i right??
as for deleting the selected record from the datagridview with my button, how to do code for this?
check my attachment for viewing...
this is my code for the datagridview content click event:
VB.NET:
Private Sub _DELETEGRID_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles _DELETEGRID.CellContentClick
Try
lblname.Text = _DELETEGRID.Item(1, e.RowIndex).Value
lblid.Text = _DELETEGRID.Item(0, e.RowIndex).Value
lblfiled.Text = _DELETEGRID.Item(3, e.RowIndex).Value
lblpic.Image = Image.FromStream(_DELETEGRID.Item(4, e.RowIndex).Value) ' fixing yet
Catch click_err As Exception
MsgBox(click_err.Message)
Exit Try
End Try
However im ecountering this error = ("Unable to cast object of type 'System.Byte[]' to type 'System.IO.Stream'.") due to wrong conversion type of the image.. i dont what to do.. my brain's rolling inside my head waaahh... please help fix this.. i know its something to do with filestream... am i right??
as for deleting the selected record from the datagridview with my button, how to do code for this?