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
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,725 views