Add a column to a able to save the calculated result ..

Source: Internet
Author: User

// No .. Peng used it by himself .. Super simple .. If you want to view more detailed information, go to Google to search [. Net to create a datatable ..
Common. DB = new common. dB ();
Datatable dt = dB. returntable ("select * From pathtb ");
DT. Rows [0] ["ptname"] = "PPP ";

Datacolumn newcolumn;
Newcolumn = DT. Columns. Add ("RTP", type. GetType ("system. String "));
Newcolumn. allowdbnull = true; // can allowdbnull be null? True False
Newcolumn. maxlength = 50;
Newcolumn. defaultvalue = "RTP ";

DT. Rows [0] ["ptname"] = "PPP ";
DT. Rows [0] ["RTP"] = "jkjjrtp ";

 

For (INT I = 0; I <DT. Rows. Count; I ++)
This. page. response. write (DT. rows [I] ["ptname"]. tostring () + dt. rows [I] ["RTP"]. tostring () + "<br> ");
DB. Close ();
// Vs2003 debugging successful!

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.