Tuesday 15 January 2013

c# - Save databound datagridview image to memoryStream -


How can any data be saved? Data bat datagoodviewviewStream from control?

I know we can do with PictureBox

  pictureBox1.Image.Save (ms, ImageFormat.Jpeg);   

What's the datagrid view about Image?


I'm getting the error "Object reference is not set for an example of an object"

  Private subconfig_photo () 'Changing the photo in binary data 'MMSstream = new memorystream () as MSS trick (Datagreat View 1. Columns (1), DataGridViewMeM column). Image. Save (MS, ImageFormat.jpg) `The correct error here 'dull photo_array bytes () = new byte (CINT (MS Length - 1)) {} ms.Position = 0 ms.Read (photo_aray, 0, photo_aray.Length) _Command.Parameters.AddWithValue ("@_m_barrImg", Photo_aray) Sub    

You Will do the exact same thing with DataGridViewImageColumn , you should get the example column like

  (DataGrid.Column [columnIndex] to get the reference as DataGridViewImageColumn). Image. Save (MS, Image format.jpg);    

No comments:

Post a Comment