I had using this code to show the alert_value in repeater. But it no output is shown in the column dso. I want to count the number of alert_value which is above than 150 which the alert id is dso. anyone can fixed it?

Dim dso1 As Label = CType(e.Item.FindControl("dso1"), Label)
        If Not IsNothing(dso1) Then
            Dim name As String

            name = dr.Item("alert_id")

            If (name = "DSO") Then

                strSQL = "SELECT COUNT(alert_value) AS DSO"
                strSQL = strSQL & "FROM(company_alert)"
                strSQL = strSQL & "WHERE(alert_id = 'DSO' And alert_value >= 150)"

                dso1.Text = e.Item.DataItem("alert_value").ToString

            End If

Have you debugged this? Is the SQL code even being called? Where abouts in the page life cycle is this code being called (Page_load or else where)?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.