I dont know why but I'm getting an error trying to get the maximum integer value from a table in the oracle database: Here is the code:
string oradb = "Data Source=";
oradb = oradb + Login.db + ";";
oradb = oradb + "User Id=" + Login.user;
oradb = oradb + ";Password=" + Login.pass + ";";
OracleConnection conn = new OracleConnection(oradb);
conn.Open();
string term = GetTerminal(terminal);
string sql = "SELECT tallynumber from "+frmSchemas.schema + ".tallies" ;
MessageBox.Show(sql);
OracleCommand cmd = new OracleCommand(sql, conn);
cmd.CommandType = CommandType.Text;
OracleDataReader dr = cmd.ExecuteReader();
MessageBox.Show("1");
Int64 TallyNo = dr.GetInt32(0);
// lblTallyNo.Text = (TallyNo).ToString()
the returned value should be: 72332 if that is any relevance