Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Anyone experimenting with Microsoft ASP.NET
I've been doing a little R&D into ASP.Net and am quite impressed so far. It
certainly seems like a reasonable competitor to the J2EE world. However I'm
having some fun when trying to use Oracle objects for OLE with this
technology. Simply put it looks as if I cannot effectively use oo4o as a
data provider for .net. has anyone else found this or am I being daft.
Apologies - this post looks like it will come out in HTML even though
Outlook calls it plain text!
Sample code and error follows
Dim objDB As OracleInProcServer.OraDatabase
Dim objDS As OracleInProcServer.OraDynaset
' set up the query
strSQL = buildOo4oQueryString() ' generates an sql statement with bindvariable :b1
'open the connection to the database
objConnect.Open("tnsalias")
' open schema
objDB = objConnect.OpenDatabase("name/password", 0)
'create parameter
objDB.Parameters.add("b1", strKeywords, 1)
'execute the SQL statement against the command to fill the DataReader
objDS = objDB.CreateDynaset(strSQL, 0)
DataGrid1.DataSource = objDS 'datagrid1 being an asp.net datagrid
DataGrid1.DataBind()
The error I get strongly suggests to me that oo4o can't be used in this way namely
Exception Details: System.ArgumentException: An invalid data source is being used for DataGrid1. A valid data source must implement either IListSource or IEnumerable.
Source Error:
Line 365: 'execute the SQL statement against the command to fill the DataReader
Line 366: objDS = objDB.CreateDynaset(strSQL, 0) Line 367: DataGrid1.DataSource = objDS Line 368: DataGrid1.DataBind()
***
-- Niall Litchfield Oracle DBA Audit Commission UK ***************************************** Please include version and platform and SQL where applicable It makes life easier and increases the likelihood of a good answer ******************************************Received on Mon Feb 04 2002 - 08:21:38 CST