VB.NET
i have a web application,in which a user information form.i want to check if employee exist or not when user a user roll no which is also PK.
THAT may be by using on text change or using button click event
asp:TextBox CssClass="form-control" runat="server" MaxLength="7" ID="txtRollNo" />TypeScript
protected void btn_Click_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtRollNo.Text)) { Employee emp = _service.GetAllEmployee().Where(x => x.Employee_Id==Employee.Cnic).LastOrDefault(); if (emp != null) { MsgLitteral.ShowNotificationInline("Record Found", false); } else { MsgLitteral.ShowNotificationInline("Record Not Found", false); } } }

Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 27, 2014, 2:13 AM EDT
_service.GetAllEmployee().Where(x => x.RollNUmber==txtRollNo.Text).LastOrDefault();