T
Tony!
Below is a snippet of code I'm working on. Don't I need some sort of
MoveNext command at the end of the While to move to the next record in
the read? I tried the reader.NextResult, but looking at online
examples, I see that in VB examples, but not in the C# examples..
Does C# somehow not need it?
Also, the 2nd question in my post here is that I created a HashTable
to hold the Agent's ID# (used as the Key in the HashTable) and the
total # of records found (used as the Value)
Thinking I can then loop throughthe HashTable contents and pull each
agent id and how many recs they had from there do more stuff with that
info.
But, googling makes me nowbelieve I was thinking in error and
something like a multidimensional array or an arraylist may be better.
I don't have much experience with either yet.... I'm a newbie
It seems to pull from a HashTable, you need to already have the Key
value in hand to get the value paired with that key, right? There is
no way to loop through and get both the key and the value associated
with it?
// Create the OracleCommand object
cmdQuery = "select agent_id, count(*) as TOTAL
from ORA_DBASE.WEEKLY_DVC_TEMP group by agent_id";
// Create the OracleCommand object
OracleCommand cmd = new OracleCommand(cmdQuery,
con);
writeLog(DateTime.Now.ToString() + " cmd
Oraclecommand created");
// Execute command, create OracleDataReader object
OracleDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
MessageBox.Show("\r\n\r\n" + ("Agent : " +
reader.GetInt32(0).ToString() + "\r\n" +
"RecordCount : " +
reader.GetInt32(1).ToString() + "\r\n"));
AgentCounts.Add(reader.GetInt32(0),
reader.GetInt32(1));
reader.NextResult();
}
Any help or advice would be appreciated
Thanks,
Tony!
MoveNext command at the end of the While to move to the next record in
the read? I tried the reader.NextResult, but looking at online
examples, I see that in VB examples, but not in the C# examples..
Does C# somehow not need it?
Also, the 2nd question in my post here is that I created a HashTable
to hold the Agent's ID# (used as the Key in the HashTable) and the
total # of records found (used as the Value)
Thinking I can then loop throughthe HashTable contents and pull each
agent id and how many recs they had from there do more stuff with that
info.
But, googling makes me nowbelieve I was thinking in error and
something like a multidimensional array or an arraylist may be better.
I don't have much experience with either yet.... I'm a newbie
It seems to pull from a HashTable, you need to already have the Key
value in hand to get the value paired with that key, right? There is
no way to loop through and get both the key and the value associated
with it?
// Create the OracleCommand object
cmdQuery = "select agent_id, count(*) as TOTAL
from ORA_DBASE.WEEKLY_DVC_TEMP group by agent_id";
// Create the OracleCommand object
OracleCommand cmd = new OracleCommand(cmdQuery,
con);
writeLog(DateTime.Now.ToString() + " cmd
Oraclecommand created");
// Execute command, create OracleDataReader object
OracleDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
MessageBox.Show("\r\n\r\n" + ("Agent : " +
reader.GetInt32(0).ToString() + "\r\n" +
"RecordCount : " +
reader.GetInt32(1).ToString() + "\r\n"));
AgentCounts.Add(reader.GetInt32(0),
reader.GetInt32(1));
reader.NextResult();
}
Any help or advice would be appreciated

Thanks,
Tony!