Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2007, 04:07 AM
Authorized User
 
Join Date: Feb 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default [?] A database connection problem

Project in ASP.Net 1.1, I am using VS.net 03, and Oracle 9i( i don't know what version) both loaded in WindowsXP SP2.

Now the problem is that, in the code I had to build a connection for the database. In that I got an error, where the dataAdapter Fills the dataSet.
 The code runs perfectly, while I use an MS Access database. And connecting string was also changed accordingly while I tried to fetch data from oracle 9i. But that time it didn't work, and I got that error.
-------------------------------------------------------------
THE CODE:

Function GetCategories() As System.Data.DataSet
        Dim connectionString As String = "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=SCT;Persist Security Info=True"
        Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString )

        Dim queryString As String = "select [sub_name], [sub_id] from [SUBJECT]"
        Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
        dbCommand.CommandText = queryString
        dbCommand.Connection = dbConnection

        Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter
        dataAdapter.SelectCommand = dbCommand
        Dim dataSet As System.Data.DataSet = New System.Data.DataSet
        Try
            dataAdapter.Fill(dataSet)
        Catch
            Response.Write("<br /><br />ERROR: " & Err.Description)
        Finally
            dbConnection.Close()
        End Try
        Return dataSet
    End Function
------------------------------------------------------------------

Now I tested the connection (using an .udl file and also using the ‘server explorer > connect database’ in VS.net.) but I got the error:
“Test connection failed because of an error in initializing provider. Oracle error occurred, but error message could not be retrieved from oracle.”
Provider: Microsoft OLEDB provider for oracle
Server name: SCT

I can connect and run oracle from SQL Plus or Worksheet, provided with the oracle. And except this problem VS.Net is running properly.

Now what could be the problem in creating the connection?
Is Oracle not properly installed?
Is there any way of fixing this problem without uninstalling and reinstalling oracle?
Is Oracle is suitable for ASP.Net applications?



Aritra Mukherjee,
CS-4th Year,
MSIT-Kolkata.
__________________
Aritra Mukherjee,
CS-4th Year,
MSIT-Kolkata.
 
Old March 2nd, 2007, 02:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. looks like the oledb driver for oracle is ruinned.. did you install the oracle client along with the oracle?? it's install the driver...
you don't need to reinstall oracle.. just a client to find it...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old March 4th, 2007, 12:05 PM
Authorized User
 
Join Date: Feb 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply.

The problem is solved.
I used Oracle oledb provider for oracle, replacing microsoft oledb provider for oracle.
i,e in connecting string, i changed 'Provider=MSDAORA.1;..' to 'Provider=OraOleDb.Oracle.1;..'

and granted authenticate user, some permission for the "Oracle91" folder.

that solves the problem.

Aritra Mukherjee,
CS-4th Year,
MSIT-Kolkata.
 
Old August 26th, 2008, 02:19 AM
Registered User
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if u have such problems with connection strings u view
www.connectionstrings.com
it'll provides connection strings for every database

cheers
kamal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Connection Problem vinyl-junkie Classic ASP Databases 2 June 2nd, 2008 03:18 AM
Database Connection Problem murali_vijaya JSP Basics 1 August 5th, 2006 10:10 AM
access database connection problem shaileshk ADO.NET 6 July 5th, 2005 03:30 AM
database connection problem farsfar2 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 March 14th, 2005 06:52 AM
Database Connection Problem Wolfgang_nl Crystal Reports 0 July 19th, 2004 01:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.