none
problems in connecting a oracle database RRS feed

  • Question

  •  

    I've got a Problem in connecting a oracle database from ASP.NET

     

    First of all I have to say that my english is not the best. Hope you understand what I have already tried to solve the problem by my self.

     

    In Visual Studio 2005 I've connected to a oracle Database with the following Connectionstring (System.Data.OracleClient.dll):

    <add name="Oracle" connectionString="Data Source=SERVER;Persist Security Info=True;User ID=USER;Password=PASSWORD;Unicode=True" providerName="System.Data.OracleClient"/>

     

    This works very fine. In Visual Studio I can access the database and can take changes on the data. But after publishing the website on a Windows 2003 Server with IIS I got problems to connect the database. I get an error that the Version of my OracleClient should be higher than 8.1.7.

    The problem is that I am using OracleClient 9.2 so I don't understand why it's not working. I even tried to give the ASP-USER an authorization on the Oracle Home directory and Microsoft.NET, too.

     

    Other programms on the Server have no problems in Connecting the database.

     

    I thought I could work if I install Visual Studio 2005 on the server. So I have installed and tested it. But its the same problem. If I am working in Visual Studio on the server I can access the database. But if I publish the site it doesn't work.

     

    Hope someone can help me. I am trying to solve this problem since 2 Days...
    Thursday, October 18, 2007 1:47 PM

Answers

  • Make sure Oracle 9i client software which is about 1gig is installed not just the dll, because more than 30 of us use Oracle 9i/10g for Asp.net 2.0 development.  And run aspnet_regiis to make sure IIS 6 is not only installed but all the features needed to run Asp.net is enabled.

     

     

     

    Thursday, October 18, 2007 3:26 PM

All replies

  • It is a known issue related to permissions in the Oracle home folder, check the link below for how to fix it.  You also need to put your TNSNAMES.ORA file in your development folder.  Hope this helps.

     

    http://theniceweb.com/LizisBlog/2006/09/oracle-client-tools-and-net.html

     

    Thursday, October 18, 2007 2:09 PM
  •  

    Hello Caddre,

     

    thank you for your answer. I already set the permissions on the Oracle Home folder to everybody. But it takes no effect. Now I copied the tnsnames.ora to nearly all directories in my development folders. But I doesn't take effect, too.

    Thursday, October 18, 2007 2:55 PM
  • Make sure Oracle 9i client software which is about 1gig is installed not just the dll, because more than 30 of us use Oracle 9i/10g for Asp.net 2.0 development.  And run aspnet_regiis to make sure IIS 6 is not only installed but all the features needed to run Asp.net is enabled.

     

     

     

    Thursday, October 18, 2007 3:26 PM
  • Hello Caddre,

     

    I am so thankful for your response. I've runned "aspnet_regiis -enable -i" in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 and now it works!

     

    Many many thanks to you!

    Friday, October 19, 2007 5:29 AM
  • I am glad I could help but the truth is I just guessed because I know Win2003 IIS6 installation and configuration takes skills I am assuming somebody skipped click on details to enable all the components needed to run Asp.net. 

    Friday, October 19, 2007 12:06 PM
  • HI Caddre:
         Are you using Visual studio 2005 to connect to Oracle database? Because I've tried to connect Oracle DB via VS2005 by its "Connect to Database" option, and choose Oracle Database as its Data Source, it showed "ORA-12541: TNS:listener could not resolve SERVICE_NAME given in connect descriptor". I'm pretty sure that the information, such as server name, user name and password are correct because I used them as the information when I used Jdeveloper 10 to connect Oracle DB. Could you tell me how do you connect to Oracle DB through VS2005 if you did that before?

    Thank-You so much.
    Thursday, November 8, 2007 12:53 AM
  • The first thing you need is to make sure you have installed the correct Oracle client software on your desktop and put your TNSNAMES.ORA file in your development folder.  Check the thread below it includes Oracle walking you though your first connection.

     

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2082601&SiteID=1

     

    Thursday, November 15, 2007 6:04 PM
  • Hii Caddre,

    I will glade if you can help my to understend somting.

     i'm using vs2008 and i create a website with web service which call oracle connection .

    when i click browes on the web service in vs2008 evreting is good but wen i publish the site into iis

    i get a message like this :

    Could not load file or assembly 'Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342'

    why ?

    Gavriel

     

    Monday, January 31, 2011 12:20 PM