what wrong in this code here data print 4 times if it exist value in only one time in table
For Each dr As DataRow In dtAtd.Rows
Dim sqlCmd As New SqlCommand("select top 10 RecTime from AtdRecord where EmplID= '" & dr(0).ToString() & "' and RecDate='" & dr(2).ToString() & "'", con)
con.Open()
rd = sqlCmd.ExecuteReader()
Dim i As Integer = 3
While rd.Read()
dr(i) = rd(0)
i += 1
End While
con.Close()