Oracle Database Connection using C#

Posted: March 17, 2009 in C#, Programming
Tags: , ,

what we must do first :

private OracleConnection conn;
private string connString = "Data Source=(DESCRIPTION="
             + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.126.11.15)(PORT=1521)))"
             + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORAPBD9)));"
             + "User Id=joe;Password=joe;";

for opening connection :

public bool OpenConnection()
{
            bool success = true;

            try
            {
                conn = new OracleConnection(connString);
                conn.Open();
            }
            catch (Exception ex)
            {
                success = false;
            }

            return success;
}

closing….

public void CloseConnection()
{
        conn.Close();
        conn.Dispose();
}
Comments
  1. Krisna says:

    Hueuhuehue……
    Koneksi.cs nih gan?

  2. stan says:

    Try EffiProz Database (http://www.EffiProz.com).

    EffiProz is a database written entirely in C#. comprehensive SQL support including Stored Procedures, Triggers and Functions. Ideal for embed in .Net applications. Support Silverlight 3 and .Net compact framework as well
    Include Visual Studio ad-in, ADO.Net provider, Entity Framework provider, etc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s