select very next elents from db

Answered 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.000

    42   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

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.000

    42   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

  • Thursday, August 09, 2012 7:51 AM
     
     Answered Has Code

    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

  • 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