• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Populating a BulletedList control from the database

Greetings all,

I don't know what I am doing wrong but I am trying to populated bullutedlist with all date values from the db so that users can click on the dates to be redirected to edit page.

Basically, we have startDate and Enddate as filter for our reports.

Assume that we have a report on the db tha thas 9/25/2009 as start date and 10/2/2009 as EndDate.

I want to display the dates like 9/25/2009 - 10/2/2009 use linkbutton control to display them so that a user can click on a date range to be redirected as stated above.

So far, even though I am not getting any errors, the nothing is getting displayed on the screen.

Still learning; so thanks a lot for your patience and assistance.

Here is what I have so far.
html code
    <asp:BulletedList ID="bltLstReportDates" OnClick="bltLstReportDates_Click" DisplayMode="LinkButton" runat="server">

   Protected Sub bltLstReportDates_Click(ByVal sender As Object, ByVal e As BulletedListEventArgs)

        Dim Conn As SqlConnection
        'Dim param As OleDbParameter
        Dim cmdcommand As SqlCommand

        Conn = New SqlConnection("data source = StPaaul;initial catalog = JITB;Integrated Security=SSPI;")
        Dim SQLSTMT As String = "Select * from CrimeReportsData ORDER BY EndDate DESC"
        Dim selectedGroupID As String = bltLstReportDates.Items(e.Index).Value
        ' Rest of code or DataSource SelectCommand assignment goes here


Open in new window

  • 2
  • 2
2 Solutions
Is the question about populating the list or making the list items as links?
simflexAuthor Commented:
both so that if I click one of the links, it takes me to an edit page.

That's my intent anyway but if I can get the items populated, and with links, i will appreciate it.

Thanks to both of you for your assistance.
simflexAuthor Commented:
Thanks to both of you.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now