When I run a query from SQLDeveloper it runs fine and retrieves all records. The code below is retrieving all but one record when a department is asking about. Is there caching of sorts of queries that a newly created entry would not show? I am using the Oracle DataAccess client and not the deprecated one.
Code:
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
string currentDatabase = universalDll.getDB();
List<string> majors = new List<string>();
try
{
OracleConnection conn = new OracleConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings[currentDatabase].ConnectionString;
conn.Open();
string sql =
"SELECT DISTINCT description,code " +
"FROM tablea a " +
"JOIN tableb b " +
"ON a.code = b.code ";
sql += "ORDER BY b.description";
OracleCommand executeQuery = new OracleCommand(sql, conn);
executeQuery.CommandType = CommandType.Text;
OracleDataReader dr = executeQuery.ExecuteReader();
while (dr.Read())
{
ddlChooser.Items.Add(new ListItem(dr.GetString(0) + "(" + dr.GetString(1) + ")", dr.GetString(1)));
}
Here was the problem: Oracle SQL Developer sometimes requires you to commit changes before other users can see them in the database. Although I could see my changes as logged in, the IIS server could not. Once I commited changes it worked fine.