Home > Default > How to write ASP code to connect to Oracle9i (Release 1)?

How to write ASP code to connect to Oracle9i (Release 1)?

November 30Hits:0
Advertisement
I am experiencing a problem when writing a program using ASP and Oracle9i (Release 1). I know the connection string when working with Access. However, the oracle9i connection string makes me headache.
A lot of thanks!

Answers

Hi,
Need few information about your system setup:
1. Which data provider are you using to connect ASP to Oracle9i?
2. Write the connect string you are using. Write the error message you get while establishing the connection.
Also try the following connect strings
1. Connection using Oracle Data Provider for .NET (ODP.NET)
In the postback method of your .aspx.cs file call this method.
a)//include these namespaces
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
b) //Declare
OracleConnection conn ;
c) //Write this method
     private Boolean getDBConnection()
          try
               //Connection Information     
                    string connectionString =
                         //username
                         "User Id=scott"
                         //password
                         ";Password=tiger"
                         //replace with your datasource value (TNSnames)
                         ";Data Source=ora9idb;"
                    //Connection to datasource, using connection parameters given above
                    conn = new OracleConnection(connectionString);
                    //Open database connection
                    conn.Open();
                    return true;
               // catch exception when error in connecting to database occurs
               catch (Exception ex)
                    //Display error message
                    return false;               }
2.
In case you are using Oracle Provider for OLEDB
use the following connect string
     string ConnectionString =
                         //Oracle OleDB .Net Data provider
                         "Provider=OraOLEDB.Oracle" +
                         //username
                         ";User Id=scott"
                         //password
                         ";Password=tiger"
                         //replace with your datasource value (TNSNames)
                         ";Data Source=ora9idb"
                         //using OLEDB .Net Data Provider features
                         ";OLEDB.NET=true" ;
Let me know if you are unable to establish the connection, after trying the preceding connect strings.
Hope that helps.
regards
[email protected]

Read other 2 answers

Tags:

Related Articles

  • How to write ASP code to connect to Oracle9i (Release 1)?November 30

    I am experiencing a problem when writing a program using ASP and Oracle9i (Release 1). I know the connection string when working with Access. However, the oracle9i connection string makes me headache. A lot of thanks!Hi, Need few information about yo

  • How to change Crystal Reports XI database name at run time from ASP code using ADOOctober 11

    Dear All, I need advises regarding to my problem below I have two database in same SQL 2005 SERVER for TEST01 and LIVE01 Environtment, and I've created more than 100 reports with Crystal Reports 11 and call it from ASP classic page. The problem is ho

  • Asp code in DreamweaverOctober 11

    How do I make this code work in Dreamweaver? I need help badly. <% ' Declare variables Dim strURL ' The URL of this page Dim cnnSearch ' ADO connection Dim rstSearch ' ADO recordset Dim strSQL ' The SQL Query we build on the fly Dim strSearch ' The t

  • Applying Template change wipe out ASP codesNovember 30

    Using WINXP Pro / IIS5.1 / DW8.01 This is a new problem for me since upgrading to DW8.01. Starting with an HTML templated webpage, I can successfully create an ASP logon webpage. However, whenever I update the site with a change made to the template,

  • Code to connect to database in  Webdynpro-- iviewsOctober 11

    Hi All- Could you let me know the code to connect to database in WebDynPro-->iviews. Regards, CrisHi, Here are the two ways of connecting to a database through coding: ////1//// Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");  

  • Crystal report run from ASP code significantly slower than when run in CRSOctober 11

    We have CRS XI R2.  I developed a report that contains several on-demand sub-reports.  The report and sub-reports are very fast when run directly from CRS.  However, when I run from ASP (users run a link from the intranet), it takes 4 times longer (1

  • Client Code not connecting to WebLogic 8.1 with Mutual AuthenticationOctober 11

    I am trying to connect to a WebLogic 8.1 web services application. The weblogic instance has mutual authentication enabled, so the client needs to send a certificate when it does an SSL handshake with the server. I am trying to connect with standalon

  • Code to connect java to LDAPOctober 11

    Hi, I am in urgency to get code to connect LDAP server on Domino server,just tell me where i can find a simple code to connect LDAP server using java.You can use the JNDI API for this The tutorial contains the basic code examples for connecting to LD

  • Sample code to connect LDAP server using jndiOctober 11

    Hi, can any one help me with sample code to connect LDAP server using jndi, like i want to make use of Ldap server for serching Active directoty. Thanks in advance, Regards MuthuYou can set ldap_auth=none for anonymous user. User/password is mandator

  • Visual C++ code to connect databaseOctober 11

    Hi I am currently writing a program in visual c++. However I need to store image to oracle database. Therefore there is a need to connect to the database. In other word, I need to connect using ODBC. However I am not sure of the code in visual c++ to

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.740 s.