Jump to content

odbcDataReader.HasRows() always false?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
I'm using this code


 System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand(sql, odbc);


                //Run the command

                System.Data.Odbc.OdbcDataReader reader2 = cmd.ExecuteReader();


                // See if the row already exists

                if (reader2.HasRows == false)


but HasRows always returns false. Is this a bug or am I doing something wrong?

#2
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
Problem solved. I had a error in my SQL statement which made HasRows always false.

#3
Ronin

Ronin

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 309 posts
haha, that is funny. I do this kind of thing all the time.