I want to save a multidimensional byte array to a SQL Server database.
I know how to save a byte array which is a image conversion to a database. For that the data type I used is image. But now I want to store another byte array which is multidimensional byte array byte [,] temp, which has two dimensions with x,y values.
I searched on internet and here, it is said that using VARBINARY format. All I want to know is if I save my multidimensional array in a VARBINARY datatype data column, will the values will be altered? Is it possible to receive the data back as multidimensional array again?
Yes, you will be able to get back your multi-dimensional array unaltered.
How can you do it? Using a Varbinary(max) field in Sql Server and saving into it the serialized multidimensional byte array. In order to get your array back, obviusly, you need to deserialize what you stored in the database.
Here is an example of how to do it: