/// <summary>
 /// Serializes the contents of the object into a byte[] and stores in the SerializationInfo block.
 /// </summary>
 /// <param name="obj">The object to serialize.</param>
 /// <param name="info">See .Net serialization.</param>
 /// <param name="context">See .Net serialization.</param>
 public void GetObjectData(object obj, SerializationInfo info, StreamingContext context)
 {
     byte[] data;
     if (obj.GetType() == typeof(DataSet) || obj is IModifiedTypedDataSet)
     {
         data = AdoNetHelper.SerializeDataSet(obj as DataSet);
     }
     else if (obj.GetType() == typeof(DataTable))
     {
         data = AdoNetHelper.SerializeDataTable(obj as DataTable);
     }
     else if (obj is DataSet)
     {
         data = AdoNetHelper.SerializeTypedDataSet(obj as DataSet);
     }
     else if (obj is DataTable)
     {
         data = AdoNetHelper.SerializeTypedDataTable(obj as DataTable);
     }
     else
     {
         throw new InvalidOperationException("Not a supported Ado.Net object");
     }
     info.AddValue("_", data);
 }