所以下面的代码不会进入循环来填充我的列表框。我的列表框显示“全选”并测试输出“进入循环”。什么会导致尝试不失败但循环也不执行?
conn.Open();
OracleCommand executeQuery = new OracleCommand(sql, conn);
executeQuery.CommandType = CommandType.Text;
OracleDataReader dr = executeQuery.ExecuteReader();
lstInstructors.Items.Clear();
lstInstructors.Items.Add(new ListItem("Select All", "%"));
string test = "entering loop";
while (dr.Read())
{
test = "start reading items";
lstInstructors.Items.Add(new ListItem(dr.GetValue(0).ToString()));
test += dr.GetValue(0).ToString();
}