By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

Displaying Tables of Oracle DB in comboBox

P: 8
Hi, I'm currently trying to display All the Tables in the Oracle database.But this exception error keep blocking me...

"System.InvalidOperationException: Operation is not valid due to the current state of the object."
Expand|Select|Wrap|Line Numbers
  1.  try 
  2. localSQL = "SELECT table_name FROM user_tables"; 
  3. OracleCommand cmdOracle = new OracleCommand(localSQL, localConnection); 
  4. cmdOracle.CommandType = CommandType.Text; 
  5. OracleDataReader drOracle = cmdOracle.ExecuteReader(); 
  6. while (drOracle.Read()) 
  7. tablelistBox.Items.Add(drOracle.GetOracleValue(0).ToString()); 
I've tried SELECT table_name FROM user_tables in the Oracle and it does generate the list of tables...but somehow this code does'nt work.

Any help or advice is appreciated.
Feb 12 '09 #1
Share this Question
Share on Google+
1 Reply

P: 8
Turely sorry the code is correct, it's just I did'n code my Oracle connection initially...
Feb 13 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.