none
radchart RRS feed

  • Question

  • hello is there any help plz guys i got "Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index " error

    Public Sub RadChart1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadChart1.Load

    Dim sqls As String = "select CallType, count(CallType) from RecCalls where CallType = 0 Group by (CallType)"

    Dim cmd As New SqlCommand
    cmd.CommandText = sqls
    Dim strcon As New SqlConnection(Conn)

    Dim CallsAdapter As New SqlDataAdapter
    CallsAdapter.SelectCommand = cmd
    cmd.Connection = strcon

    strcon.Open()

    '
    Dim result As Integer


    Dim strType As String
    Dim i As Integer
    For i = 0 To 4 + 1
    Select Case (RadChart1.Series.Item(0).Item(i).Name)
    Case "in"
    strType = 0
    Case "out "
    strType = 1
    Case "Missed"
    strType = 2
    Case "RAdio"
    strType = 3
    End Select
    Next i
    sqls = "select CallType, count(CallType) from RecCalls where CallType = " & strType & " Group by (CallType)"
    result = cmd.ExecuteScalar()
    RadChart1.Series.Item(0).Item(i).Name() = RadChart1.Series.Item(0).Item(i).Name() + " " + result
    End Sub

    thank in advance

     
    Wednesday, July 25, 2007 7:49 AM