Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error filling dataset with OracleDataAdapter in VB.NET

779391May 17 2011
Hi...

This solution executes a procedure inside a package in an Oracle database and returns a data set with 2 fields: one numeric and one a description varchar.

I have a solution with VS2008 (actually i have the same issue with vs2010) with two proyects:

(A) A Dll project type that allows me to access a database via System.Data.OracleClient
(B) A WinForms Project that allows me to use the first (A) making the call to storeprocedures in the database.



Sample code of (A):

Imports System.Data.OracleClient
....
...Declarations and more....
...

If Not myDataset Is Nothing Then

'Configura el objeto adapter con el objeto Command para recuperar la información
'y dejarla sobre el dataset
Dim adpAdapter As New OracleDataAdapter(_oracleCommand)


* adpAdapter.Fill(myDataset)*


adpAdapter = Nothing

DatasetStatus = Nothing
DatasetStatus = New DatasetClass(myDataset)

Return True

Else

_oracleCommand.ExecuteNonQuery()

Return True

End If


(B) The code sample is this:

Dim db As New xxxDll.OracleClass()
Dim mytable As New DataSet

db.AddParameter("T_PRUEBA_CURSOR", OracleType.Cursor, mytable, ParameterDirection.Output)
If db.ExecuteStoredProcedure("Pck_Prueba.Sp_Prueba", mytable) Then

End If


When the errors occurs?

Here: adpAdapter.Fill(myDataset)

What is the error?

Error converting the DataSet param to DateTime.
InnerException: The object must implements IConvertible

The funny thing is that when placed around the code in the same "layer" and not in 2 layers works perfectly ...

Something happens when the connection object is encapsulated database and its value is returned to its level or upper layer


This error does not allow me to implement the philosophy of 3 layers, does anyone have any idea?

Thanks in advance ....

Comments

unknown-7404
You should not do this.

Environment variables such as PATH can only give preference to one item of any given name. With DLLs for example the first DLL of any given name that is found will be the one loaded by Windows. It would be up to the software doing the loading to determine if that is the correct version and most software just looks by name.

That is what is known as 'dll hell'; the wrong version of a dll is being used.

You don't need both clients installed so why do you want to do that?
Pl identify which version of Win 7 - you will need Professional or higher. Pl also identify which exact version of Oracle client.

I have no personal experience with this myself, but the 11gR2 docs say you can install both the 32-bit and 64-bit clients as long as you use different ORACLE_BASE directories.

http://docs.oracle.com/cd/E11882_01/relnotes.112/e23557/toc.htm#CJADGJDB

HTH
Srini
Helios-GunesEROL
Hi;

By using different path yes you can install.

Please review:
Master Note For Oracle Database Client Installation [ID 1157463.1]
Client / Server / Interoperability Support Between Different Oracle Versions [ID 207303.1]


Regard
Helios
941843
Windows 7 Enterprise

Oracle Client 11g (11.2.0.1.0)
941843
Doesn't this write both ORACLE_HOME paths to the PATH environment variable, and then cause, as mentioned above, DLL hell? With WOW64, it is unclear to me how Microsoft separates 32-bit paths from 64-bit paths.

Unfortunately, my company is running 32-bit Microsoft Office 2007 and other 32-bit programs that use the Oracle thick client install, and my company also uses 64-bit programs that require the Oracle thick client install too.

The solution thus far has been to uninstall one of the programs, and thus clean-up the %PATH% environment variable; or rearrange the order of the Oracle client homes in %PATH% to make the broken one work.
941843
After researching the links, this was still unclear if the 2 clients would conflict with each other.
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 14 2011
Added on May 17 2011
0 comments
1,721 views