get output parameter from objectdatasource

Last post 05-16-2008 11:38 AM by LeMerovingian. 6 replies.

Sort Posts:

  • get output parameter from objectdatasource

    05-16-2008, 4:09 AM
    • Loading...
    • LeMerovingian
    • Joined on 03-07-2006, 9:11 AM
    • Perth, Western Australia
    • Posts 258

    i have seen a lot of examples of how to get the output parameter from a proc when data is inserted but how do i get the output parameter when the page first loads based on a select query.

     

     

  • Re: get output parameter from objectdatasource

    05-16-2008, 4:40 AM
    • Loading...
    • murthysrn
    • Joined on 12-15-2006, 5:22 AM
    • Bangalore
    • Posts 264

    Call the procedure in the Page Load Event....

    Thanks & Regards,
    Murthy.
  • Re: get output parameter from objectdatasource

    05-16-2008, 4:48 AM
    • Loading...
    • LeMerovingian
    • Joined on 03-07-2006, 9:11 AM
    • Perth, Western Australia
    • Posts 258

    do u mean call the proc directly or use the objectdatasource to extract it?

  • Re: get output parameter from objectdatasource

    05-16-2008, 4:56 AM
    • Loading...
    • murthysrn
    • Joined on 12-15-2006, 5:22 AM
    • Bangalore
    • Posts 264

    yes...

    explain me clearly your requirement......

     

     

    Thanks & Regards,
    Murthy.
  • Re: get output parameter from objectdatasource

    05-16-2008, 5:53 AM
    • Loading...
    • ShivaKarthik
    • Joined on 04-15-2008, 1:11 PM
    • Hyderabad
    • Posts 218

    In the sense if you want to have the event generated in the page_Load event itself definitely you have to get the parameter from the previous pages right??????

    in the page_Load event pass the cookies or session variables

    // declare a Variable i; 

    protected void Page_Load (object sender,EventArgs e)

    {

    i=""+Request.Cookies["Karthik"]["Data"];

    or

    i=""+Session["karthik"];

    write the stored procedure here

    }

    Mark As Answer if this helps you

    Further Queries Recommended

    Happy CodingWink

    Regards,
    B.ShivaKarthik
    Software Engineer
    Hyderabad,India
  • Re: get output parameter from objectdatasource

    05-16-2008, 6:48 AM
    • Loading...
    • LeMerovingian
    • Joined on 03-07-2006, 9:11 AM
    • Perth, Western Australia
    • Posts 258

    is there not a better way to do this? i was hoping i could get it from the objectdatasource somehow.

    writing a stored procedure just to get the output parameter defeats the purpose of having an objectdatasource in the first place (especially when the data it returns is the same)
     

  • Re: get output parameter from objectdatasource

    05-16-2008, 11:38 AM
    Answer
    • Loading...
    • LeMerovingian
    • Joined on 03-07-2006, 9:11 AM
    • Perth, Western Australia
    • Posts 258

    ok i got it sussed now. it has to be done in the objectdatasources Selected event, ie

     

    int totalPages = (int)e.OutputParameters["NumberOfPages"]; 

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter