Hi Mozarar,

I still get the error "object not set to a reference of an object". 
For some reason the dataset value is lost when the event is called.

What have I missed?


 Dim ds1 As New DataSet()
    Dim ds2 As New DataSet()

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As 
System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then

            RenderColours()
        End If
    End Sub

    Public Sub RenderColours()


        Dim myconnection As New OleDb.OleDbConnection()

        myconnection = common.connDB()

        Dim strColourSql As String = "select qoh, shopsales.size, 
shopsales.shop, shopsales.style, shopsales.colour, co.colourdesc, 
sz.sizedesc from shopsales inner Join shops on shopsales.shop = 
shops.shop inner join colours co on shopsales.style  = co.style and 
shopsales.colour = co.colour inner join sizes sz on shopsales.style = 
sz.style and shopsales.size  = sz.size where shopsales.shop = 1 and 
shopsales.style = '10475RIB1'"

        myconnection.Open()

        Dim myColourDataAdapter As New OleDb.OleDbDataAdapter
(strColourSql, myconnection)

        myColourDataAdapter.Fill(ds1)

        Datalist1.DataSource = ds1
        Datalist1.DataBind()

        ' myconnection.Close()
        ' myColourDataAdapter.Dispose()
        ' myconnection.Dispose()

        Session("ds_colours") = ds1

    End Sub


    Sub temp2(ByVal sender As Object, ByVal e As 
DataListItemEventArgs)


        Dim dg As DataList = CType(e.Item.FindControl
("dtlistsColour"), DataList)
        If e.Item.ItemType = ListItemType.Item Or _
               e.Item.ItemType = ListItemType.AlternatingItem Then

            Dim drvColour As DataRowView = CType(e.Item.DataItem, 
DataRowView)
            Dim intColour As Integer
            intColour = CType(drvColour("colour"), Integer)




            dg.DataSource = ds1.Tables(0).Select("colour=" & 
intColour & "")
            dg.DataBind()

        End If
    End Sub



--- In [EMAIL PROTECTED], "zazo_zazo70" 
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Dim dg = CType(e.Item.FindControl("dtlistsColour"), DataList)
> change to 
> Dim dg As DataList = CType(e.Item.FindControl("dtlistsColour"), 
> DataList)
> you can IM Me on [EMAIL PROTECTED] , if you would like to follow 
> up 
> 
> HTH 
> Best Regards
> Mohmed Zahra



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to