(1) filter the data in the datatable:
Datatable dt = new datatable ();
Dataview DV = DT. defaultview;
DV. rowfilter = string. Format ("name = {0} And namet = {1}", value, valuet );
Datatable newdt = DV. totable ();
(2) query by time period Conditions
Data SQL statement: SJ between sj1 and sj2
When retrieving data in the background, format the string:
String sj1 = This. SJ. Text. Trim () = ""? "": Convert. todatetime (this. SJ. Text. Trim (). tostring ("D-M month-YYYY ");
(3) JS verification numbers
JS method:
Function valnum (ID ){
Var val = Document. getelementbyid (ID). value; // The value of each part.
VaR mod =/^ [+-]? /D + (/./d + )? $ // Verify the numerical Validity
If (Val! = ""){
If (! Mod. Test (VAL )){
Document. getelementbyid (ID + 'info'). style. Display = "Block ";
Return false;
} Else {
Document. getelementbyid (ID + 'info'). style. Display = "NONE ";
}
}
Else {
Document. getelementbyid (ID + 'info'). style. Display = "NONE ";
}
Return;
}
Add <span id = "bysrinfo" style = "color: red; display: none"> enter a number </span> behind the page label as a prompt Panel for information.
(4) JS summation
Directly process the obtained value with + =, and the program will be connected as a string ..
Function valtolnum (ID ){
Var val = Document. getelementbyid (ID). value; // The value of each part.
VaR valvalue = Document. getelementbyid ("bzhj"). value; // value of the total value control
VaR mod =/^ [+-]? /D + (/./d + )? $ // Verify the numerical Validity
If (Val! = "") {If (! Mod. Test (VAL) {...} // verify the information
// Calculate the obtained value * 1 as a number for the sum.
Valvalue = valvalue * 1 + val * 1;
Document. getelementbyid ("bzhj"). value = valvalue;
Return;
}