1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

connect oracle data base in the .net..

Discussion in 'General' started by vkselvaa, Oct 24, 2011.

  1. vkselvaa

    vkselvaa Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    couldn't set the EZCONNECT Setup and TNSNAMES Setup.
    becas the file refered in the setup instruction not in my system.
    what will do the correct flow to access the oracle data.

    i install the following oracle db in my system.

    1] Oracle Database 10g Express Edition.
    2] Oracle - OraClient11g_home1.
    3] ODAC112021Xcopy_x64.
    4] ODAC10203x64. i extract this file. but i couldn't install the setup file.


    this is my application script:

    I refer only the oracle.web and coulldn't refer the oracle.dataaccess.dll because it is not displayed in the list.

    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;

    namespace OraWinApp
    {
    public partial class Form1 : Form
    {

    public Form1()
    {
    InitializeComponent();
    }


    private void Form1_Load(object sender, EventArgs e)
    {

    }

    private void button1_Click(object sender, EventArgs e)
    {

    try
    {

    string oradb = "Data Source=192.168.1.35//ORCL;";
    OracleConnection conn = new OracleConnection(oradb); // C#
    conn.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = conn;
    cmd.CommandText = "select employee_id from employees where first_name = 'steven'";
    cmd.CommandType = CommandType.Text;
    OracleDataReader dr = cmd.ExecuteReader();
    dr.Read();
    label1.Text = dr.GetString(0);
    conn.Dispose();
    }

    catch (System.Exception ee)
    {

    textBox1.Text = ee.Message;
    }

    }
    }
    }


    when i build the program ORA-12521: TNS:listener does not currently know of instance requested in connect descriptor is displayed..

    anybody clarify this forum step by step...
     

    Attached Files:

  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You need not install a separate client when XE is installed as it provides one. How is your tnsnames.ora file configured? Do you have a listener.ora file, and if so how is it configured? We can't answer your question without this information.
     
  3. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    What article?
     
  4. vkselvaa

    vkselvaa Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Hi.
    how did you connect oracle database...
    shall i do any configuration.
     
  5. vkselvaa

    vkselvaa Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Is it correct the location of tnsnames.ora : ORACLE_HOME\Network\Admin\Sample\
    but i have no this file and the listener file. so what i will do...
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO