How to nest 2nd datalist instead of gridview

Discussion in 'ASP .Net' started by staeri@gmail.com, Mar 2, 2006.

  1. Guest

    I have one datalist containg another datalist in the ItemTemplate. I
    used to have a gridview inside the datalist instead but I'm trying to
    change that to another datalist but the code for binding the inner
    datalist doesn't work:

    Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e
    As System.Web.UI.WebControls.DataListItemEventArgs)
    Dim s As SqlDataSource = e.Item.FindControl("SqlDataSource2")
    s.SelectParameters("AccountGroup").DefaultValue =
    e.Item.DataItem("AccountGroup")
    End Sub

    I receive an error message telling me "Object reference not set to an
    instance of an object."

    What can be wrong?

    Regards,

    S
     
    , Mar 2, 2006
    #1
    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. Nevyn Twyll
    Replies:
    8
    Views:
    1,972
  2. H5N1
    Replies:
    0
    Views:
    2,771
  3. Chris

    Nest Gridview Visability

    Chris, Apr 1, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,169
    Eliyahu Goldin
    Apr 1, 2007
  4. NH

    Nest gridview RowCommand

    NH, Nov 19, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    416
  5. smay

    Nest DataList in DataGrid

    smay, Oct 28, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    118
Loading...

Share This Page