MySQL Forums
Forum List  »  Connector/ODBC

C# via OdbcConnection: can't get latest committed data
Posted by: Silan Liu
Date: September 03, 2014 07:38PM

Hi,

I have a table called "docs", with two rows:

project doc_num
---------------------
ABC 1
ABC 2


I have some very simple C# code:

OdbcConnection conn = new OdbcConnection("...");
OdbcCommand cmd = conn.CreateCommand();
cmd.CommandText = "select max(doc_num) from docs where project = 'ABC'";
object objNewNum = cmd.ExecuteNonQuery();

If I run this code, I got 1. But if I run the SQL directly from MySQL workbench, I get "2".

What's wrong?

Options: ReplyQuote


Subject
Written By
Posted
C# via OdbcConnection: can't get latest committed data
September 03, 2014 07:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.