|
using System;
using System.Data;
using System.Runtime.Serialization;
namespace SimmoTech.Utils.Data
{
/// <summary>
/// Replacement for the standard DataSet to allow Fast Serialization
/// during remoting.
/// </summary>
[Serializable]
public class FastSerializableDataSet: DataSet, ISerializable
{
#region Constructors
public FastSerializableDataSet(): base() {}
public FastSerializableDataSet(string dataSetName): base(dataSetName) {}
#endregion Constructors
#region ISerializable Members
protected FastSerializableDataSet(SerializationInfo info, StreamingContext context)
{
AdoNetHelper.DeserializeDataSet(this, (byte[]) info.GetValue("_", typeof(byte[])));
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("_", AdoNetHelper.SerializeDataSet(this));
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Simon Hewitt is a freelance IT consultant and is MD of Hunton Information Systems Ltd.
He is currently looking for contract work in London.
He is happily married to Karen (originally from Florida, US), has a lovely daughter Bailey, and they live in Kings Langley, Hertfordshire, UK.