Nested Master Detail List Problem

U

ultraweaver

Hi,

I have a datalist and a gridview nested in the item template and trying
to bind the gridview to the datalist. I am getting teh error...

System.NullReferenceException: Object reference not set to an instance
of an object.

I am uncertain as to why. I have data. I am following this quick start
file (but with my own data).

http://dotnetjunkies.com/QuickStart...pnet/samples/data/NestedMasterDetailsList.src

Here is my sub...

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("InvoiceID").DefaultValue =
e.Item.DataItem("InvoiceID")
End Sub

The error happens on the line
"s.SelectParameters("InvoiceID").DefaultValue =
e.Item.DataItem("InvoiceID")".

Any ideas?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top