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.