Add a series of new data to the data table

Source: Internet
Author: User

This. DS = rule. getdataset (); // get Dataset

Datarow ROW = Ds. Tables ["row"]. newrow (); // create a row

DS. Tables ["row"]. Rows. Add (ROW); // Add a row

This. savedate ();

 

Datareader objects can be created by retrieving data from the data source using the executereader method of the command object.

Sqldatareader reader = command. executereader ();

While (reader. Read ())

{Console. writeline (string. Format ("0", reader [0]);}

Read () is a Boolean value used to forward data to the next data record and return data one by one. False bounce.

Add a series of new data to the data table

 

Format:
Character Description sample output

C currency string. Format ("{0: C3}", 2) $2.000
D decimal string. Format ("{0: D3}", 2) 002
E scientific count 1.20e + 001 1.20e + 001
G regular string. Format ("{0: g}", 2) 2
Separate string. Format ("{0: n}", 250000) 250,000.00 with N semicolons
X hexadecimal string. Format ("{0: x000}", 12) C
String. Format ("{:000. 000}", 12.2) 012.200

 

 

Description
Format (string, object) replaces the format item in the specified string with the text equivalent item of the value of the specified object instance.
Format (string, array <> [] () []) replaces the format item in the specified string with the text equivalent item of the value of the corresponding object instance in the specified array.
Format (iformatprovider, String, array <> [] () []) replaces the format item in the specified string with the text equivalent item of the value of the corresponding object instance in the specified array. The specified parameter specifies the format of the region.
Format (string, object, object) replaces the format items in the specified string with the text equivalent items of the values of the two specified object instances.
Format (string, object, object) replaces the format items in the specified string with the text equivalent items of the values of the three specified object instances.

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.