//--- linq example for datatable
private void CheclLq()
{
string str = "select * from login";
DataUtility dut = new DataUtility();
_hgfhg = dut.GetDataTable(str);
var qry=from c in _hgfhg.AsEnumerable() where c.Field<string>("Username")=="ADMIN" select c;
DataTable x = qry.CopyToDataTable();
GridView1.DataSource = x;
GridView1.DataBind();
}
//------drop down fill by enumetable range
private void GrpFill()
{
var val = Enumerable.Range(18, 10);
foreach (var item in val)
{
DropDownList1.Items.Add(item.ToString());
}
}
No comments:
Post a Comment