and thanks for reading.
I am building a data entry form. I am trying to figure out a way to let the user to provide a criteria (last name for instance), search the emplo
I suggest using Linq.
Consider Scott Gu's Example blog........
http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx
public static void GetEmployeeIDByLastName(string lastName)
{
DataContext dc = new DataContext();
var queryResult = from q in dc.Employee
where q.EmployeeLastName.Equals(lastName)
select new {
EmployeeID = q.EmployeeID
}
foreach(var empID in queryResult)
{
//pass the empID value back to the display
}
}