C# .NET - Problem In Read Image From Datagrid.
Asked By ALOK RANJAN on 23-Apr-12 03:00 AM
I have scenario that when I insert image from picture box control in database also it reflect at Data grid at the time of insertion . when we double click on data grid cell to update that record all values we can read easily In Textbox from data grid but i am unable to read image value from data grid cell how i can resolved this problem .
error occur Like Error 45 Cannot implicitly convert type 'string' to 'System.Drawing.Image'
please help me.........
[)ia6l0 iii replied to ALOK RANJAN on 26-Apr-12 12:19 AM
If you are trying to read the image from the DataGrid/Or any other datasource, then you should cast it to the right type.
In my humble opinion, you read the cell's text and you are trying to assign to a property that is of type Image.
Something like this:
Image img = e.Cells.Text;
Please post your code for more accurate answers.
Hope this helps.