Click here to Skip to main content
15,905,148 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,
am working on entity frame work
i want the next record to be display in the textboxes when i click next button
i have below structure

ID,CustomerID,name where ID is the primarykey

ID CustomerID name 1 4 aa
4 6 bbb
5 9 ccc
8 10 ddd

if current row id is 4 ,i want to get the row where id==5 and display it in
texboxes
am trying below code
int next=convert.toint32(textbox1.text);
testingEntities te = new testingEntities();
       var entity = (from n in te.tblddls
                     where n.id == next
                     orderby n.id
                     select n).Skip(1).Take(1);
       return entity;

am getting null as output

Thanks inadvance
Posted
Updated 6-Jun-12 3:13am
v4

1 solution

hi all,


int next = Convert.ToInt32(TextBox1.Text);
            testingEntities te = new testingEntities();
            var entity = (from t in te.tblddls
                          where t.id > next
                          orderby t.id
                          select t).FirstOrDefault();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900