I want to populate combo box with data from OracleDataReade r
, but "Invalid attempt to read when no data is present."
is thrown.
there are two rows returned , then too why such error.
plzzz share ur knowledge to help me out with this probs.
my code is as below,
, but "Invalid attempt to read when no data is present."
is thrown.
there are two rows returned , then too why such error.
plzzz share ur knowledge to help me out with this probs.
my code is as below,
Code:
Private Sub FillRoleDesc() Dim strrefNo, sql As String Dim dr1 As OracleDataReader 'Dim strGCRNno As String Try If Trim(txtRefNo.Text) <> "" Then strrefNo = Trim(txtRefNo.Text) dr = funRefernece(strrefNo) Do While dr.Read ' dr.GetString(0) strGCRNno = dr.Item("CD_REF_NO") Loop End If dr1 = funAccList(strGCRNno) If dr1.HasRows Then 'here is get error "Invalid attempt to read when no data is present." ddlOtherRel.DataSource = dr1 ddlOtherRel.DataTextField = dr1(0) ddlOtherRel.DataValueField = dr1(0) ddlOtherRel.DataBind() 'ddlOtherRel.Items.Insert(0, New ListItem("Select", "0")) End If Catch ex As Exception lblError.Text = ex.Message End Try End Sub
Comment