Here is the code that can be used for converting a DataSet into its corresponding byte array. Sometimes when we need to send the data across the network through WCF service, we can get advantage of sending our data into a byte array. The reason behind to send the data in Byte Array format is that byte array is the one of the primitive data type available in .Net
private byte[] ConvertDataSetToByteArray(DataSet dataSet)
{
byte[] binaryDataResult = null;
using (MemoryStream memStream = new MemoryStream())
{
BinaryFormatter brFormatter = new BinaryFormatter();
dataSet.RemotingFormat = SerializationFormat.Binary;
brFormatter.Serialize(memStream, dataSet);
binaryDataResult = memStream.ToArray();
}
return binaryDataResult;
}


Hemant SrivastavaPosted Feb 12, 2018, 10:53 AM EST
Http://hemant-srivastava.blogspot.com/2013/03/c-code-to-deserialize-bytearray-into.html
Hemant SrivastavaPosted Feb 12, 2018, 10:52 AM EST
Hi Anbu.To convert Byte[] into dataTable, refer to this link: http://hemant-srivastava.blogspot.com/2013/03/c-code-to-deserialize-bytearray-into.html
anbu johniPosted Feb 11, 2018, 11:04 PM EST
How to convert bytes[] into datatable in c#
Gowtham RajamanickamTOP 100Posted Apr 1, 2015, 12:31 AM EDT
nice one,..