Inserting item from datalist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Skinnypig
    New Member
    • Jan 2008
    • 1

    Inserting item from datalist

    Hi, there will be an error-Object reference not set to an instance of an object.
    whenever i tried to insert item in the datalist to my shopping cart.
    Can anyone help? I think the error is at datalist1.selec teditem.findcon trol..

    This is part of the code copied:

    Dim a As Image
    Dim b As Label
    Dim c As Label
    Dim d As Label
    Dim f As Label

    a = DataList1.Selec tedItem.FindCon trol("Image1")
    Session("a") = a.ImageUrl
    b = DataList1.Selec tedItem.FindCon trol("descripti onLabel")
    Session("b") = b.Text
    c = DataList1.Selec tedItem.FindCon trol("priceLabe l")
    Session("c") = c.Text
    d = DataList1.Selec tedItem.FindCon trol("quantityL abel")
    Session("d") = d.Text
    f = DataList1.Selec tedItem.FindCon trol("orderLabe l")
    Session("f") = f.Text
    Session("member ID") = "bx"

    cmd = "Insert into ShoppingCart (imagePath,desc ription,price,q uantity,order_s tatus,Username) values ('" & Session("a") & "','" & Session("b") & "','" & Session("c") & "','" & Session("d") & "','" & Session("f") & "','" & Session("member ID") & "')"
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    What language are you using, and what version of ASP (ASP.NET / ASPX or "classic" ASP)? What is your IDE?

    Jared

    Comment

    Working...