title: problem with oracle connection in c#
body: <p>I have a Windows XP  machine used to create .Net applications with VS 2008.</p>
  
  <p>I want to connect to a remote network server (using Windows xp) that is running an Oracle 10g database. </p>
  
  <p>I am using the code below (with the first connection string) to connect directly to a version of 10g that is running on the same machine with no problems, however when I try to connect to the network machine, it actually crashes my application. </p>
  
  <p>I have tried several variations of connection strings as I feel that I must be making a syntax error somewhere. </p>
  
  <p>What concerns me is that I have dual try/catch statements in the application and I do not understand why it simply does not refuse the connection and report the error. </p>
  
  <p>I suppose the real question is 'what is the correct syntax for the connection string'....or WHATEVER the hell I am doing wrong. </p>
  
  <p>Any help or suggestions are greatly appreciated. Thank you in advance.</p>
  
  <pre><code>//Class Variables
  string CONNSTR = "Server=192.168.0.1:1521;User ID=zahid;Password=abc123;";
  
  
  public Oracle()
  {
    InitializeComponent();
  }
  
  //Methods
  private void TestMyOracleConnection()
  {
    OracleConnection Conn = new OracleConnection(CONNSTR);
    try
    {
      Conn.Open();
      MessageBox.Show("Oracle Connection Established", "Success");
    }
    catch (OracleException ex)
    {
      MessageBox.Show(ex.Message, "Oracle Connection Failed!");
    }
    catch (Exception ex)
    {
      MessageBox.Show(ex.Message, "Oracle Connection Failed!");
    }
    finally
    {
      Conn.Close();
      MessageBox.Show("Oracle Connection Closed", "Success");
    }
  }
  
  private void buttonTestConnection_Click(object sender, EventArgs e)
  {
    TestMyOracleConnection();
  }
  </code></pre>