Try dr = Nothing Dim str As String str = GridView1.SelectedValue(0).Value cmd = New SqlCommand("Select* from ProgramDetails.Subjects where SubjectCode='" & str & "'", cn) dr = cmd.ExecuteReader While (dr.Read) txtIdNumber.Text = dr(0) txtSubjectCode.Text = dr(1) txtSubjectName.Text = dr(2) If dr(3) = "Core" Then rbnCore.Checked = True Else rbnElective.Checked = True End If txtUserId.Text = dr(4) txtPassword.Text = dr(5) End While dr.Close() btnSave.Enabled = False Catch ex As Exception End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)