Storing an image in dataset, proper type.

Just a quick one, if you want to store an image to a dataset, and are creating the dataset in code, here’s the proper type:

System.Type.GetType(“System.Byte[]“)

It’s a little confusing because if you use Visual Studio’s XSD editor, it lists the type as System.Byte(). And of course System.Byte would compile but it would not behave as expected.

In the schema, the type is stored as: type=”xs:base64Binary”

Just a heads up.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>