Get next record !!!!!
-
hi all, let's suppose var q = context.Student.where(s=>s.id==1).?????????? how to i get next record where s.id==1 ? :((
-
hi all, let's suppose var q = context.Student.where(s=>s.id==1).?????????? how to i get next record where s.id==1 ? :((
It's simple to iterate over the query. As Linq uses deferred execution, you could do the following:
foreach (Student item in q)
{
Console.WriteLine(item.Name);
}Or, you could convert the output to a list:
List<Student> students = q.ToList();
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
hi all, let's suppose var q = context.Student.where(s=>s.id==1).?????????? how to i get next record where s.id==1 ? :((
Perhaps this will work for you.
var studentList = from s in context.Students
where s.id.Equals(1)
select s;foreach(Student student in studentList)
{
Console.Write(student.id);
}Cheers Disgyza Programmer Analyst
-
hi all, let's suppose var q = context.Student.where(s=>s.id==1).?????????? how to i get next record where s.id==1 ? :((