select very next elents from db
-
Thursday, August 09, 2012 5:27 AM
Hai gud morn to all
Qid Question Startdate end date
41 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.00042 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.000
43 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.000
44 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.000
I have a table like this all are different Questions and dates..fine
i am showing 1 of this question in one of my page
suppose
i am showing
Qid 41
and i am giving a link button there ie "next"
while clicking next i want to display the next Question..that is Question number 42....
i think i will get this using a Query
give me solution and ur suggetions asap...
thank youu
- Moved by Sethu SrinivasanMicrosoft Employee Tuesday, August 14, 2012 12:56 AM TSQL (From:SQL Server Tools)
All Replies
-
Thursday, August 09, 2012 5:25 AM
Hai gud morn to all
Qid Question Startdate end date
41 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.00042 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.000
43 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.000
44 WHO is The Prime Minister of India 2012-06-07 00:00:00.000 2012-06-13 00:00:00.000
I have a table like this all are different Questions and dates..fine
i am showing 1 of this question in one of my page
suppose
i am showing
Qid 41
and i am giving a link button there ie "next"
while clicking next i want to display the next Question..that is Question number 42....
i think i will get this using a Query
give me solution and ur suggetions asap...
thank youu
- Merged by Maggie LuoMicrosoft Contingent Staff, Moderator Sunday, August 12, 2012 5:24 PM
-
Thursday, August 09, 2012 7:51 AM
Hi,
I think you can use parametrized query or (Store procedure which takes a parameter) and in your .NET code pass the parameter for the SP each time next button pressed.
something like this.
CREATE PROC Questiosns @ID INT AS BEGIN SELECT Question, startdate, enddate FROM tablename WHERE QID = @id END
in your .net you may have counter which will be increased by one each time the user press next button.
I hope this is helpful
Please Mark it as Answered if it answered your question
OR mark it as Helpful if it help you to solve your problem
Elmozamil Elamir Hamid
MCTS: SQL Server Administration/Development
MyBlog

- Proposed As Answer by RahulKapoor Thursday, August 09, 2012 10:34 AM
- Marked As Answer by Kalman TothMicrosoft Community Contributor, Moderator Wednesday, August 15, 2012 7:15 AM
-
Thursday, August 09, 2012 8:06 AM
Hi,
Same post on
http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/66d772b0-8fec-4186-aae1-1a092bec4caf
Please Mark it as Answered if it answered your question
OR mark it as Helpful if it help you to solve your problem
Elmozamil Elamir Hamid
MCTS: SQL Server Administration/Development
MyBlog


