Friday, December 23, 2022

LINQ get selected fields without Entity or modal

 var ssIPVac = allData.Where(s => s.Field<string>("institute") == ddlInstitute.SelectedItem.Text && s.Field<string>("discipline") == ddlDiscipline.SelectedItem.Text).Select(d => new { ss = d.Field<int>("ss"), ip = d.Field<int>("ip"), vacancy = d.Field<int>("vacancy") }).First();


                    txtSanctionedStrength.Text = ssIPVac.ss.ToString();

                    txtInPosition.Text = ssIPVac.ip.ToString();

                    txtVacancy.Text = ssIPVac.ip.ToString();

No comments:

Post a Comment