hi friends am creating a project ,
now i want to bind next nearest record in the table , i am done but i cant able to get exact output. folloeing is my using query.
select TOP 1 * from tbl_FreeAnswer where qid<>'14' and qid>'14' and rollno='R01'
above query give the result of 2nd record , that mean it takes number 14 as 2 so it give 3rd one result. but i want 15 th record only .
string query1 = "select TOP 1 * from tbl_FreeAnswer where qid<>'" + lblQuestionId.Trim() + "' and qid>'" + lblQuestionId.Trim() + "' and rollno='"+lblRollNo.Text.Trim()+"' and status='A' order by id asc";
SqlCommand nextcmd1 = new SqlCommand(query1, con);
SqlDataAdapter nextsda1 = new SqlDataAdapter(nextcmd1);
DataTable dt1 = new DataTable();
nextcmd1.CommandType = CommandType.Text;
nextsda1.Fill(dt1);
so friends if anyone suggest me how can i get nearby record of 13 trh number .
thanking you
Paul.S