Wednesday, 29 May 2013

Checklist box and radio button validatation using jquery

var v = $("[id$=rdgroup]").find("input:checked").length;

if (v == 0) {alert(
'Please select atleast one group');
return false;}

var v2 = $("[id$=chkPlant]").find("input:checked").length;
if (v2 == 0) {alert(
'Please select atleast one plant');
return false;}

Tuesday, 28 May 2013

Select Data From Data Table

DataTable dtPerson = new DataTable("Person");

DataTable dtPersonFiltered = new DataTable("PersonFiltered");dtPerson.Columns.Add(
new DataColumn("Height", typeof(int)));dtPerson.Columns.Add(
new DataColumn("Gender", typeof(char)));dtPerson.Rows.Add(170,
'F');dtPerson.Rows.Add(155,
'F');dtPerson.Rows.Add(166,
'M');dtPerson.Rows.Add(140,
'M');dtPerson.Rows.Add(180,
'M');
DataRow[] Filteredresult = dtPerson.Select("Height >= 130 AND Gender = 'M'");
if (Filteredresult.Length > 0)dtPersonFiltered = Filteredresult.CopyToDataTable();