[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

No Data present in oledbReader

Greetings,

I get a "No data exists for row/column" exception with the below code.  How can I not have data if the HasRows is true?

Thanks


mConnection.Open()
 Dim mCommand As New OleDbCommand("Select QID from Questions WHERE MasterNumber  = " & CStr(MasterNumber) &  AND BankID = " & CStr(BankID), mConnection)
        Dim mReader As OleDbDataReader
        mReader = mCommand.ExecuteReader
        If mReader.HasRows Then
            While mReader.HasRows
                Result = mReader.Item("QID")
            End While
        Else
            Result = False
        End If
0
vaughnwhitehead
Asked:
vaughnwhitehead
  • 2
1 Solution
 
vaughnwhiteheadAuthor Commented:
THanks
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
Welcome..
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now