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

Operation not valid

P: n/a
Ciao,

Hi,
a datagrid on my form displays a table T, fine.
On the form I have a button. I want to execute a query on T, just
clicking that button.
DB is Oracle. Button_Click code is:

....
Dim QSele As String = "select field1 from T"
Dim mycmd As New OracleCommand(QSele, con)
mycmd.CommandType = CommandType.Text
Try
mycmd.ExecuteNonQuery() '
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
mycmd = Nothing
End Try

At line mycmd.ExecuteNonQuery I get an error:
"Operation is not valid due to the current state of the object"
Qualcuno puo' aiutarmi? Ciao,
in una datagrid su un form visualizzo correttamente il contenuto di una

tabella T.
Accanto c'e' un bottone, cliccando sul quale voglio eseguire una query
sulla stessa tabella.
Il database e' Oracle, all'inizio della mia classe ho la riga:
Imports Oracle.DataAccess.Client
Il codice del click del bottone e':
....
Dim QSele As String = "select field1 from T"
Dim mycmd As New OracleCommand(QSele, con)
mycmd.CommandType = CommandType.Text
Try
mycmd.ExecuteNonQuery() '
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
mycmd = Nothing
End Try
Quando il programma esegue mycmd.ExecuteNonQuery ho l'errore:
"Operation is not valid due to the current state of the object"

Anybody can help? Thanks

N! Xau

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.