/ Published in: C#
Expand |
Embed | Plain Text
public DataTable DeepCopy(DataTable TargetTable) { DataTable copyTable = null; // コピー元オブジェクトをシリアライズします。 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); formatter.Serialize(stream, TargetTable); stream.Position = 0; // シリアライズデータをコピー先オブジェクトにデシリアライズします。 copyTable = (DataTable)formatter.Deserialize(stream); return copyTable; }
You need to login to post a comment.
