

If the above steps didn't help you resolve your problem or were not available, locate your error code in the following table, and follow the recommended resolutions for that error code. Note Make sure that the device drivers that are being installed are compatible with your current Windows version and platform. If the device was preinstalled on the computer, and the computer manufacturer does not have an updated driver for the device, visit the device manufacturer's website. If the device was installed after the purchase of the computer, visit the device manufacturer's website. If the device was preinstalled on the computer, visit the computer manufacturer's website. Follow their installation or update instructions. Update the device driver from the vendor's website.

Updated the device driver from the vendor's website Update the hardware's device driver through Windows Update. ReceiptCollection items = (ReceiptCollection)binaryFormatter.Update the device driver from Windows Update Using (MemoryStream memoryStream = new MemoryStream(bytes)) For retrieving it, I did the following: connection.Open() This is for sending a byte array to the data base. What I did was (implemented in your code): BinaryFormatter binaryFormatter = new BinaryFormatter() All I was recieving after the memoryStream.Write() method, was an array of zeroes. Everywhere I looked around, they have the same code marked as the solution (as your code presented on the top) but I couldn't make it run correctly. I was facing the same problem in the serialization and deserialization of a custom class. ReceiptCollection items = (ReceiptCollection)binaryFormatter.Deserialize(memoryStream) // the error happened here MemoryStream memoryStream = new MemoryStream(bytes) WHERE LogHeaderID=2" īyte bytes = (byte)cmd.ExecuteScalar() īinaryFormatter binaryFormatter = new BinaryFormatter() Using ( cmd = new (sql, connection))īyte bytes = new byte MemoryStream memoryStream = new MemoryStream() īinaryFormatter.Serialize(memoryStream, items)

() VALUES binaryFormatter = new BinaryFormatter() String connectionString = "my connection" My code sample: private void InsertObject() I am trying to insert a collection of custom class into sql database & retrieve it the insertion going well but retrieving the data & deserialize give me this error I faced this error while deserialization a custom object
