using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Oracle.DataAccess.Client;
using System.Data;


namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string oradb = "user id=hr;password=hr; data source=svrname";

            using (OracleConnection conn = new OracleConnection(oradb))
            {
                conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection = conn;
                cmd.CommandText = "select department_name from departments";
                cmd.CommandType = CommandType.Text;
                using (OracleDataReader dr = cmd.ExecuteReader())
                {
                    dr.Read();
                    this.Label1.Text = dr.GetString(0);
                }
            }
        }
    }
}
