Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
If catlist.Items.Item(1).Selected = True Then <-----error(why)
Dim conn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\miss\My Documents\Visual Studio 2005\WebSites\Classified adv\App_Data\ESGDB.mdf;Integrated Security=True;User Instance=True")
Dim sql As String = "select Title,Text, Image,ContactInfo from ClassifiedAdv where CCatID='1' AND Type='Supply'"
Dim bookdpt As New SqlDataAdapter(sql, conn)
Dim bds As New DataSet()
pgdatalist.DataSourceID = ""
pgdatalist.DataSource = bds
pgdatalist.DataBind()
End If
error:
Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index


