Handwriting dataset,datatable

Source: Internet
Author: User

A: DataSet

1DataSet ds =NewDataSet ();//Create a DataSet2DataTable dt =NewDataTable ();//Create a Datatalbe3 4Dt. Columns.Add (NewDataColumn ("ID",typeof(int)));//Create a column in the Dt_dry table5Dt. Columns.Add (NewDataColumn ("SQBM",typeof(string)));6Dt. Columns.Add (NewDataColumn ("UNAME",typeof(string)));7 8  for(inti =0; I < ODS. tables[0]. Rows.Count; i++)9 {TenDataRow dr =dt. NewRow (); One  Adr["ID"] = i +1; -dr["SQBM"] = ODS. tables[0]. rows[i]["SQBM"]. ToString (); -dr["UNAME"] =username; the     if(i = = ods.) tables[0]. Rows.Count-1) - { - dt. Rows.Add (DR); - ds. Tables.add (DT); + } -       Else + dt. Rows.Add (DR); A         } at}

II: DataTable

1DataTable dt =NewDataTable ();2 3Dt. Columns.Add (NewDataColumn ("ID",typeof(string)));4Dt. Columns.Add (NewDataColumn ("UName",typeof(string)));5 6   for(Int i =0; I < DS. table[0]. Rows.Count; i++)7{8DataRow dr =dt. NewRow ();9dr["ID"] = ds. table[0]. rows[i]["user_id"].tostring ();Tendr["UName"] = ds. table[0]. rows[i]["Struname"].tostring (); One       dt. Rows.Add (DR); A  -}

Handwriting dataset,datatable

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.