I am developing a smart application in C# using CF 3.5 which requires the ability to capture signatures.
To implement this I am using Resco’s InkBox control. To save and load the images I have attempted to convert the VB source code provided into C#. Resco InkBox source code
The application saves the signature without any issues however, when I try to load the file from the database I get an Invalid Cast Exception on the following line of code;
MemoryStream stream = new MemoryStream(Convert.ToByte(dr["Signature"]));
Which I converted from the following VB code.
New System.IO.MemoryStream(CType(myReader("Signature"), Byte()))
I have tested the VB code provided and it works perfectly. Is anyone able to offer me any suggestions to solve this issue because I am absolutely stumped. All help will be greatly apprieciated.
Thanks in advance
You need to cast to a byte array