Results 1 to 2 of 2

Thread: asp.net can't bind the datareader to a listbox..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    asp.net can't bind the datareader to a listbox..

    I am using data access application block. the program runs fine untill it reached 'Listbox1.datasource = drcategories".
    the error message is " "Object reference not set to an instance of an object." any idea why it does that?

    Dim drCategories As SqlDataReader
    drCategories = SqlHelper.ExecuteReader(sqlConn, CommandType.Text, "Select categoryid From Categories")
    Try
    ListBox1.DataSource = drCategories
    Listbox1.databind()
    Catch exp As Exception
    Response.Write(exp.message)
    End Try

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    resolved..no worries...

    resolved...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width