/// <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);
 }
Пример #2
0
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue("_", AdoNetHelper.SerializeDataSet(this));
 }
Пример #3
0
 public void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     byte[] data = AdoNetHelper.SerializeDataSet(m_dataset);
     info.AddValue("DATASET_DATA", data);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 public override void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue("_", AdoNetHelper.SerializeDataSet(this));
     info.AddValue("Opened", _opened);
     info.AddValue("DatabaseType", _dbType);
 }
Пример #5
0
 ////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////
 void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
 {
     info.AddValue("DATASET_DATA", AdoNetHelper.SerializeDataSet(this));
     info.AddValue("DIC_TABLE_TO_TYPE", m_dicPrivateNomTableToType);
     info.AddValue("DIC_TYPE_TO_TABLE", m_dicPrivateTypeToNomTable);
 }