Anyone experimenting with Microsoft ASP.NET
Date: Mon, 4 Feb 2002 14:21:38 -0000
Message-ID: <3c5e98f6$0$8509$ed9e5944_at_reading.news.pipex.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 objConnect As New OracleInProcServer.OraServerClass()
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
An invalid data source is being used for DataGrid1. A valid data source must implement either IListSource or IEnumerable. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
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 - 15:21:38 CET