If I choose CUT or DELETE from the context menu, I get a DBNull error popping up. Of course, this is not expected (is it ever?) since I spent a good chunk of time yesterday wrestling with the null issue and the image. I thought I had that thing licked.
What can I do about the delete/cut process on the pictureedit control?
Thanks,Bill
Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.
And, here's the code (offending line specified):
I must have done something different to my previous data table...like set all null values to an empty byte array, or something. It worked before my recent re-import of the data. I'll have to review my records to see what might have happened.
Would you suggest a default value for the 'image' field in a SQL Server data table? Or, would a null value be acceptable? If a null is acceptable, how should I handle it in the BO? Then, how would I handle it in the PictureEdit control?
Thanks!Bill
This works. I am still running some tests, but at least I have a way around the issue.
this
That is why my navigation disappeared. And, also explains the confirmation popup when closing the window.
Whew! Glad that's over.Bill
(note: cross-posted on purpose--http://forum.strataframe.net/Topic13453-7-1.aspx)
Thanks for the help!Bill
private void SketchPictureEdit_EditValueChanged(object sender, EventArgs e){ if (SketchPictureEdit.EditValue == new byte[] {}) { this.partsBO1.sketch = new byte[] {}; SketchPictureEdit.EditValue = string.Empty; } else { this.partsBO1.sketch = (byte[])SketchPictureEdit.EditValue; }}
Since I have the control bound to the data already, this was redundant. And, it caused other navigation problems at various points in the user experience.