• 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">
     </asp:BulletedList>

codeBehind:
   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;")
        Conn.Open()
        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

        Response.Redirect([String].Format("EditReport.aspx?ReportGroupID={0}&bltLstReportDates={1}"))

Open in new window

0
simflex
Asked:
simflex
  • 2
  • 2
2 Solutions
 
CodeCruiserCommented:
Is the question about populating the list or making the list items as links?
0
 
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.
0
 
CodeCruiserCommented:
0
 
simflexAuthor Commented:
Thanks to both of you.
0

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