What's wrong with BinaryFormatter.Deserialize() ?
On Nov 24, 9:16 pm, wigzell <cathywigz...@yahoo.co.uk> wrote: > In C#, I create a byte[] using BinaryFormatter etc. as follows: > > decimal[] theArray = new decimal[2]; > theArray[0] = (decimal) 36300288.734436237; > theArray[1] = (decimal) 34176522.502899267; > BinaryFormatter bf = new BinaryFormatter(); > MemoryStream ms = new MemoryStream(); > bf.Serialize(ms, theArray); > byte[] bytes = ms.GetBuffer(); > > This is then stored to SQL Server 2005 in varbinary field. When > loading this from SQL, I get the byte[] back - so my question is, how > do I convert the byte[] back to the decimal[]? > > Many thanks, > Cathy