locked
Connecting to Oracle 10g Server from Visual C# 2005 Express

    Question

  •  

    I am developing an Application which needs to connect to Oracle Database 10g (Server ) which is installed on my Pc.

    I see that Oracle Dataprovider for .NET is listed in control Panel(of Windows) however when try to list datasources from C# 2005 express IDE I do not find Oracle listed in database.

     

    Adding Oracle.DataAccess as reference does not work.

     

    Is there any way to connect to Oracle 10g server from visual studio 2005 C#.

    Sunday, August 19, 2007 7:21 AM

All replies

  • Hi

    The language specific Express edition I think only Microsoft databases are supported however VWD(visual web developer) support other data sources and I don't know why could be related to data knowledge of each team. Try the thread below for more info but you could test drive Team Suites it is good for 6 months I enjoyed working with Oracle 9i/10g using Team Suites by the time it expires VS2008 is live.  If you choose to use Team Suites with Oracle put your TNS.ORA file in your development drive.   Hope this helps.

     


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

     

    http://msdn2.microsoft.com/en-us/evalcenter/bb188238.aspx

     

    Sunday, August 19, 2007 6:28 PM
  • Hello Ashish,

     

    From your description, I get to know that you want to connect to Oracle 10g using Visual C# 2005 Express IDE.

     

    For your concern, you can try to follow the steps:

    1.Download .NET Managed Provider for Oracle from Microsoft website - http://www.microsoft.com/downloads/details.aspx?familyid=4F55D429-17DC-45EA-BFB3-076D1C052524&displaylang=en, which is an add-on component to the .NET Framework that provides access to the Oracle database. This provider relies upon Oracle Client Interfaces provided by the Oracle Client Software.

    Try to install this package to your PC after you download it.

     

    2.You need to add a reference to System.Data.OracleClient.dll assembly of the framework in your project solution explorer. The detailed action is right click on References->Add Reference. Select System.Data.OracleClient.dll in .Net tab and then press ok. Then make sure you'll see System.Data.OracleClient.dll has added to your References.

     

    3.Connect to Oracle database using Visual C# 2005 Express,the sample codes as follows:

           using System.Data;
           using System.Data.OracleClient;

     

          OracleClient.OracleConnection conn =
            new OracleClient.OracleConnection ();


        // TODO: Modify the connection string and include any
        // additional required properties for your database.
        conn.ConnectionString = "Data Source=" +
            "<oracle data source name>;Integrated Security=yes";
       

        try
        {
            conn.Open();
            // Insert code to process data.
        }
            catch (Exception ex)
        {
            MessageBox.Show("Failed to connect to data source");
        }
        finally
        {
            conn.Close();
        }

     

    If you have any questions when trying my suggestions, please don't hesitate to let me know. Thanks.

     

    Citizens on the earth

     

    • Proposed as answer by Shadab Ansari Tuesday, February 17, 2009 10:49 AM
    Wednesday, August 22, 2007 5:47 AM
  • Hello Sir,

    I am developing web application using ASP.NET using VB.I used OracleClient(Oracle.Net provider) for connecting Oracle database,its working fine.But my problem is how to generate crystal report using oracleClient(Oracle.Net provider).How to get connection from oracle to Reports.I can't able to add database fields to Crystal Reports.Please give me a solution.

    Saturday, February 09, 2008 1:20 PM
  • how to find data-source .i am current using oracle 10g.

    thanks

     


    kishan
    Thursday, January 19, 2012 6:03 PM