Jacob
Jacob

Reputation: 525

MySQL .Net Connector - SELECT always returns 0 rows

I have a simple SELECT statement:

select field1,field2 from table where id='1234';

That always works in mysql workbench but in my .Net application always returns 0 rows. I have INSERT and UPDATE statements in the same application that work fine. What gives?

Dim con As New MySqlConnection(blah blah blah)
Dim cmd As New MySqlCommand(queryString,con)
Dim reader As MySqlDataReader = cmd.ExecuteReader()
reader.read() 
Nope.

Upvotes: 0

Views: 276

Answers (2)

Darren
Darren

Reputation: 329

Ok I am assuming Entlib is being used

Try Reader = Con.ExecuteReader(cmd)

For some reason this has to be run this way.

Upvotes: 0

Lynn Crumbling
Lynn Crumbling

Reputation: 13367

Try dropping the apostrophes around the number.

Upvotes: 1

Related Questions