CYQ. Data lightweight Data access layer (4) constructing Data unit Columns

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.