(1) Screening data in a 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) When the query is made according to the time period condition
Data SQL statements in the conditional: SJ between SJ1 and Sj2
To format the obtained string string when fetching data in the background:
String sj1 = This.sj.Text.Trim () = = "" ": Convert.todatetime (This.sj.Text.Trim ()). ToString ("D-m month-yyyy");
(3) JS verification number
JS Method:
function Valnum (ID) {
var val = document.getElementById (id). value; Values for each part
var mod =/^[+-]?/d+ (/./d+)? $/; Verifying number 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
}
After the page tag, add: <span id= "Bysrinfo" style= color:red; Display:none "> Please enter a number </span> as a tip panel for information
(4) JS sum
The obtained value is treated directly with + +, and the program is connected as a string.
function Valtolnum (ID) {
var val = document.getElementById (id). value; Values for each part
var valvalue = document.getElementById ("Bzhj"). Value; Value of the total value control
var mod =/^[+-]?/d+ (/./d+)? $/; Verifying number Validity
if (Val!= "") {if (!mod.test (val)) {...} ...} Verifying information
Sum first *1 The value you get, so you can treat it as a number
Valvalue = Valvalue * 1 + val * 1;
document.getElementById ("Bzhj"). Value = Valvalue;
Return
}