With the structure class of the data structure unit, the data unit column set is easy to write, because all the data unit Structures add up and become the data unit column set.
Therefore, we can easily write the following classes:
Code
/** // <Summary>
/// Header list set
/// </Summary>
Public class MDataColumn: List <MDataCellStruct>
{
Public MDataColumn ()
: Base ()
{
}
Public MDataColumn (int capacity)
: Base (capacity)
{
}
}
Look, few lines of code
To cache the architecture to the cache in the future, we add a Clone () method to it.
The method is as follows:
Code
Public MDataColumn Clone ()
{
MDataColumn mcs = new MDataColumns (base. Count );
For (int I = 0; I <base. Count; I ++)
{
MDataCellStruct mcb = base [I];
Mcs. Add (mcb );
}
Return mcs;
}
Here, we will Add a method for adding columns to the column set as follows;
Code
Public void Add (string columnName, System. Data. SqlDbType SqlType)
{
MDataCellStruct mdcStruct = new MDataCellStruct (columnName, SqlType, false, true, 0, System. Data. ParameterDirection. InputOutput );
This. Add (mdcStruct );
}
Now, the header list set is complete.