Listener Control

C:> LSNRCTL STATUS


LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-MAY-2009 12:31:17



Copyright (c) 1991, 2005, Oracle. All rights reserved.



Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production

Start Date 27-MAY-2009 11:06:27

Uptime 0 days 1 hr. 24 min. 49 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Default Service XE

Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora

Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bsnlCNN1)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=8080))(Presentation=HTTP)(Session=RAW))

Services Summary...

Service "CLRExtProc" has 1 instance(s).

Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...

Service "PLSExtProc" has 1 instance(s).

Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Service "XEXDB" has 1 instance(s).

Instance "xe", status READY, has 1 handler(s) for this service...

Service "XE_XPT" has 1 instance(s).

Instance "xe", status READY, has 1 handler(s) for this service...

Service "xe" has 1 instance(s).

Instance "xe", status READY, has 1 handler(s) for this service...

The command completed successfully













Step 2: Try to TNSPING the oracle instance from the command prompt:



The result will look like this :



C:>tnsping xe



TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 27-MAY-2009 12:21:56



Copyright (c) 1997, 2005, Oracle. All rights reserved.



Used parameter files:

C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora





Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =bsnlCNN1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xe)))



OK (10 msec)







Step 3: Copy the following code and save it is test.aspx. Make necessary corrections and run it.



<%@ Page Language="C#" Debug="true" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>

<%@ Import NameSpace="System.Data.OracleClient" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<%

String oradb = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=bsnlCNN1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xe)));User Id=CNNlocal;Password=CNN123;";

OracleConnection conn = new OracleConnection(oradb);

conn.Open();

string sql = "select * from master_institute";

OracleCommand cmd = new OracleCommand(sql, conn);



OracleDataReader dr = cmd.ExecuteReader();

dr.Read();



label1.Text = dr["c_institute_name"].ToString();





%>





</div>

<asp:Label ID="label1" runat="server" Text="Label"></asp:Label>

</form>

</body>

</html>









Thank you spending your time here.
If possible you; can leave some comments or suggestions.
Thanks a lot once again.
Google Search
Disclaimer and Copy Right