Click here to Skip to main content
16,005,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am try to connect ASP.net application to oracle database. But i am getting the error as 'Oracle(tm) client and network componnents not found'. I have already installed this on my pc. I have used the below...
C#
protected void Page_Load(object sender, EventArgs e)
    {
        string connString = "Driver={Microsoft ODBC for Oracle};Server=Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.55.60.140)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=MMS5x10)));User Id=mms5x_manager;Password=mms5x_manager;"; 
        
        OracleConnection conn = new OracleConnection(connString);
        if (conn.State != ConnectionState.Open)
            conn.Open();
        OdbcDataAdapter da = new OdbcDataAdapter("SELECT * FROM CO_DOWNLOAD_HISTORY", conn);
        DataSet ds = new DataSet("STDTABLE");
        da.Fill(ds, "STDTABLE");
        GridView1.DataSource = ds.DefaultViewManager;
        GridView1.DataBind();
        // Close connection
        if (conn.State == ConnectionState.Open)
            conn.Close();
    }
Posted
Updated 11-May-12 2:17am
v3
Comments
Bernhard Hiller 11-May-12 4:02am    
Is your application a 32bit or 64bit application? Is your Oracle ODBC driver a 32bit or 64bit version?

1 solution

I wonder why you're using ODBC with OracleConnection class. What I would suggest is to use ODP.NET[^] instead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900