Re: Connecting to an Oracle Database

From: John Jansen \(MSFT\) (johnjan_at_online.microsoft.com)
Date: 05/04/04


Date: Tue, 4 May 2004 15:29:03 -0700

You can also use FrontPage, if you want.

Open your site in FrontPage
Data..Insert Data View
Click Add to Catalog under "Database Connections"
Put in your Oracle connection string in the custom connections dialog

-- 
Thanks!
John Jansen
Microsoft Office FrontPage
This posting is provided "AS IS" with no warranties, and confers no rights.
"David McKenzie" <DavidMcKenzie@bonbon.net> wrote in message 
news:uFd$togMEHA.1900@TK2MSFTNGP10.phx.gbl...
> Hi Steve,
>
> Let me start by saying that database is far from my area of expertise, but
> with some help here I managed the following code:
> Try
>
> '#1: setup the database connection info
>
> oraConn = New OracleConnection(connectionString)
>
> oraCmd = New OracleCommand
>
> '#2: query information
>
> oraCmd.CommandType = CommandType.Text
>
> oraCmd.CommandText  =  "SELECT ..."
>
> '#3: the OracleCommand object needs to be associated with an active
> connection
>
> oraConn.Open()
>
> oraCmd.Connection = oraConn
>
> oraDA = New OracleDataAdapter(oraCmd) 'executes the query information set 
> at
> #2:
>
> myDataSet = New DataSet
>
> mydatagrid = New DataGrid
>
> newColumn = New BoundColumn
>
> 'Define grid columns
>
> ...
>
> Controls.Add(mydatagrid)
>
> ' you can access the data via myDataSet.Tables(0) using the row index.
>
> ' this data can also be bound to a DataGrid with this syntax:
>
> oraDA.Fill(myDataSet)
>
> mydatagrid.DataSource = myDataSet
>
> mydatagrid.DataBind()
>
> '[Text] = Str(mydatagrid.Items.Count)
>
> oraConn.Close()
>
> Catch ex As Exception
>
> oraConn.Close()
>
> [Text] = "Oracle Connection failed" & " - " & ex.Message
>
> End Try
>
>
> "Steve" <webmaster@gottschalks.com> wrote in message
> news:hsff90ld2p7tt0qackon5tlu2k5pbmn5kh@4ax.com...
>> Hi,
>>
>> I am trying to connect to an Oracle database from my web parts.  Is
>> there something that I need to configure or some special object that I
>> need to use to get a connection.  I am trying to use the OleDb objects
>> in .NET and it just hangs.  I use the same code in a normal webform
>> and it works perfectly.  I really need to get this working.  Any help
>> would be greatly appreciated.
>>
>> Environment:
>>
>> OS: Windows 2003
>> DEV: VS.NET 2003 Architect
>> DB: Oracle 8
>> APP: SharePoint Services 2003
>> SEC: Full Trust
>>
>> CODE SAMPLE:
>>
>> Private Function BuildDataset() As Dataset
>>
>> Dim strSQL As String = "SELECT * FROM <SOMETABLE>"
>> Dim iConn As OleDbConnection = New OleDbConnection("<CONN STRING>")
>> Dim iCmd As OleDbCommand = New OleDbCommand()
>> Dim iAdapter As OleDbDataAdapter
>> Dim oDS As Dataset = New Dataset
>>
>> With iCmd
>>         .CommandText = strSQL.ToString
>>         .CommandType = CommandType.Text
>>         .Connection = iConn
>> End With
>>
>> iAdapter.Fill(oDS)
>>
>> iAdapter.Dispose
>> iCmd.Dispose
>> iConn.Dispose
>>
>> Return oDS
>>
>> This just hangs and returns nothing.  If I use similar code against a
>> SQL database I get the dataset with no problems.
>>
>
> 


Relevant Pages

  • RE: ADO.Net Connection Pooling Problem with Oracle
    ... the CLR is releasing the connection to your database. ... the number of database sessions in Oracle seem to ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: form submit to SQL Server w/Database wizard
    ... You need to have a login/password set in the global.asa that allows writing to the database. ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... > Hi - looking for help with a submit form to SQL Server. ... The connection is a dsn on the same server ...
    (microsoft.public.frontpage.client)
  • Re: Change port for SQL Server connection
    ... are connecting to the database. ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... > When I define a connection there doesn't seem to be anywhere to enter it. ... > Jonathan Blitz ...
    (microsoft.public.frontpage.client)
  • RE: Query Oracle, show results (need help!!)
    ... After the DB connection, put this... ... I am trying to log into an Oracle database, ... Prepare the SQL statement for running and it'll be stored in Oracle buffer ...
    (perl.beginners)
  • Re: Unable to Create Database Connection
    ... Do you have an existing database that you could import into your web site? ... Thomas A. Rowe (Microsoft MVP - FrontPage) ... Try creating your connection from Tools> Web Settings ...
    (microsoft.public.frontpage.client)