Dim
cn As New Oracle.DataAccess.Client.OracleConnection("Data Source=server;User ID=test;Password=test;")cn.Open()
Try Dim sqlstr As Stringsqlstr =
"select * from ash" Dim cmd As New Oracle.DataAccess.Client.OracleCommand(sqlstr, cn) Dim dr As New OracleDataAdapterdr.SelectCommand = cmd
Dim ds As New DataSetdr.Fill(ds,
"test")DataGridView2.DataSource = ds
Catch ex As Exception Throw ex End Try
When i run this it always give me the connection must be open for this operation. How do i solve this. Let me know any solutions.
Thanks,
Kris

Connection must be opened for this operation ERROR
Quang N
am also getting the same problem and have drilled it down to the point where you create the oracledataadapter object and attempt to fill it.(In my case I am using a datareader and immediately i do an executereader on the command object the error pops up) I read on some forums somewhere to check the location of oraops.dll, they said that the one that resides in c:\windows\system32 is an incorrect version.
anyways i am going to check it out and see if it solves my problem.
will fill you in on what happens.
Regards,
mike
albatroz
Regards,
-chris
Dwarf
the solution is as follows:
Reinstall the Oracle Data Access components and specify in the location option :
OraDb10g_home1 instead of
OraClient10g_home1
This will point Oracle to the right location to find Odp.NET provider (which is causing the error)
Let me know if this works for you.
Regards,
Mike
Brian Clark BCBSMT
You have to verify if the version of the ODAC is the same in the development machine and the target machine.