Hi, i am getting an error like invalid attempt to read when reader is closed

Try
            Dim k As Integer = 0
            Dim l As Integer = 0
            Dim str_select As String = "select * from Suggetion_master where que_no=" & FrmErrorQuestions.dtgErrorQue.Item(0, FrmErrorQuestions.dtgErrorQue.CurrentRow.Index).Value
            dtgQueSuggestion.RowCount = 1
            nxtlsdquescon.Open()
            cmd = New SqlCommand(str_select, nxtlsdquescon)
            ' cmd.Connection.Open()
            cmd.ExecuteReader()
            Do While (dr.Read)
                k = k + 1
                dtgQueSuggestion.RowCount = dtgQueSuggestion.RowCount + 1
                dtgQueSuggestion.Rows(l).Height = 150
                dtgQueSuggestion.Item(1, l).Value = k
                dtgQueSuggestion.Item(1, l).Value = dr.Item("suggetion")
                l = l + 1
            Loop
            nxtlsdquescon.Close()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

can anybody help me

Hi everybody
i am forgot to add

dr = cmd.ExecuteReader()

problem has been solved.

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.