unable to read data from more than 1 row
<p>i have a problem reading data from the table. This is the sample of my coding</p>

<pre><code>Dim SqlQry As String = "SELECT Distinct(RechargeAmt) from KioskItem where TelcoID='" &amp; TelcoID &amp; "'"
        Dim SqlCmd As New SqlCommand(SqlQry, Conn)
        Dim dr As SqlDataReader = SqlCmd.ExecuteReader
        dr.Read()
        If dr.HasRows Then
            While dr.Read()
                Dim SqlQry As String = "SELECT Distinct(RechargeAmt) from KioskItem where TelcoID='" &amp; TelcoID &amp; "'"
        Dim SqlCmd As New SqlCommand(SqlQry, Conn)
        Dim dr As SqlDataReader = SqlCmd.ExecuteReader
        dr.Read()
        If dr.HasRows Then
            While dr.Read()
                RechargeAmt = dr(0)
                a = a &amp; RechargeAmt &amp; ";"
            End While
        End If
        If a = 0 Then
            Return RechargeAmt
        Else
            Return a
        End If           
</code></pre>

<p>My problem is if the data has more than one row, it has no problem saving the data into a string but when my data in the table has only one rowm, it is unable to read the data. i try this</p>

<pre><code>If dr.HasRows Then
            RechargeAmt = dr(0)
            While dr.Read()
                a = a &amp; RechargeAmt &amp; ";"
            End While
        End If
        If a = 0 Then
            Return RechargeAmt
        Else
            Return a
        End If      
</code></pre>

<p>but it still unable to read the data from the table</p>
