Object DataSource parameters

Discussion in 'ASP .Net' started by thomson, Aug 9, 2007.

  1. thomson

    thomson Guest

    Hi ,
    i have a function which takes object as a parameter


    eg: getCustomers(Customer objCustomer)



    i have a gridview which inturn calls a objectDataSource which calls
    getCustomers(Customer objCustomer)


    How ever i have to send some parameters like objCustomer.Custid=
    Somevalue to the objectDataSource,


    How do i specify the values for the same

    thanks in Advance

    thomson
    thomson, Aug 9, 2007
    #1
    1. Advertising

  2. On Aug 9, 7:50 am, thomson <> wrote:
    > Hi ,
    > i have a function which takes object as a parameter
    >
    > eg: getCustomers(Customer objCustomer)
    >
    > i have a gridview which inturn calls a objectDataSource which calls
    > getCustomers(Customer objCustomer)
    >
    > How ever i have to send some parameters like objCustomer.Custid=
    > Somevalue to the objectDataSource,
    >
    > How do i specify the values for the same
    >
    > thanks in Advance
    >
    > thomson


    You can use an event handler for the ObjectDataSource's Selecting
    event to the page's code-behind class

    Protected Sub objCustomer_Selecting (sender As Object, e As
    ObjectDataSourceSelectingEventArgs) Handles objCustomer.Selecting
    e.InputParameters("Custid") = Custid
    End Sub

    http://www.asp.net/learn/data-access/tutorial-06-vb.aspx

    Hope it helps
    Alexey Smirnov, Aug 9, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brock Allen

    Re: Datasource parameters

    Brock Allen, Sep 20, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    467
    Not Me
    Sep 23, 2005
  2. Greg Ramsey
    Replies:
    0
    Views:
    759
    Greg Ramsey
    Mar 19, 2006
  3. Replies:
    0
    Views:
    333
  4. Adam Knight
    Replies:
    0
    Views:
    757
    Adam Knight
    Apr 3, 2007
  5. Florian Loitsch
    Replies:
    11
    Views:
    246
    Michael Winter
    Mar 15, 2005
Loading...

Share This Page