ERROR CONNECTING TO ORACLE. SOCKET OPERATION ENCOUNTERED A DEAD NETWORK

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
aissa gonzalez
Posts: 3
Joined: Sat 03 May 2008 16:35

ERROR CONNECTING TO ORACLE. SOCKET OPERATION ENCOUNTERED A DEAD NETWORK

Post by aissa gonzalez » Sat 03 May 2008 17:01

Hello
I need some help. I´m using a pocket pc with OraDirect.net and

I'm getting THIS ERROR WHEN I TRY TO OPEN A CONNECTION (ORACLE).
A SOCKET OPERATION ENCOUNTERED A DEAD NETWORK



Imports CoreLab.Oracle

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim connectionString As String = GetConnectionString()
Dim queryString As String = _
"SELECT * FROM BD.IF_CATEGORIAS"
Dim connection As New OracleConnection(connectionString)
Dim command As OracleCommand = connection.CreateCommand()
command.CommandText = queryString
Try
connection.Close()

connection.Open()
Dim dataReader As OracleDataReader = _
command.ExecuteReader()
Do While dataReader.Read()
Console.WriteLine(vbTab & "{0}" & vbTab & "{1}", _
dataReader(0), dataReader(1))
Loop

dataReader.Close()

Catch ex As OracleException

Dim errorMessage As String = "Code: " & ex.ErrorCode & vbCrLf & _
"Message: " & ex.Message

End Try

End Sub

Private Shared Function GetConnectionString() As String

Return ("Data Source=local;Persist Security Info=True;User ID=USER;password=PASS;Unicode=True;SID=ORCL")



End Function
End Class

:? thanks in advance for your help

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Mon 05 May 2008 15:04

Could you please specify the version and edition of OraDirect .NET, Visual Studio, Oracle server and .NET Framework (CF)?

aissa gonzalez
Posts: 3
Joined: Sat 03 May 2008 16:35

Post by aissa gonzalez » Mon 05 May 2008 17:23

Alexey.mdr wrote:Could you please specify the version and edition of OraDirect .NET, Visual Studio, Oracle server and .NET Framework (CF)?
OraDirect.Net 4.60.33
Oracle server 9i
Compact Framework 2.0
visual Studio 2005

thanks

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Tue 06 May 2008 11:42

Do you have Active Sync installed?
Do you have a device connected?
Try pinging your localhost (“Run” -> “ping 127.0.0.1”)
Try running the “Ping” sample from %Program Files%CoreLab\OraDirect.NET2 Mobile\Samples\Ping
Do you have your firewall on (try turning it off, or allow using the needed port)?

Usually, the problem is in Virtual PC Network driver which, as a matter of fact,
has been removed from the default setup of Visual Studio 2005.
So you need to install some specific software.
The application you should look for is ActiveSync (version 4.0. or higher).

aissa gonzalez
Posts: 3
Joined: Sat 03 May 2008 16:35

Post by aissa gonzalez » Tue 06 May 2008 23:57

Alexey.mdr wrote:Do you have Active Sync installed?
Do you have a device connected?
Try pinging your localhost (“Run” -> “ping 127.0.0.1”)
Try running the “Ping” sample from %Program Files%CoreLab\OraDirect.NET2 Mobile\Samples\Ping
Do you have your firewall on (try turning it off, or allow using the needed port)?

Usually, the problem is in Virtual PC Network driver which, as a matter of fact,
has been removed from the default setup of Visual Studio 2005.
So you need to install some specific software.
The application you should look for is ActiveSync (version 4.0. or higher).

Rigth now My application and the oracle database are hosted in the same computer,
and the last error message was "An existing connection was forcibly closed by the remote host".

Testing the application in a different machine, using Pocket Pc emulator
and PDT syncronized with the PC, using USB cable, I got connected and everything was ok.

Now i try to connect wireless from the PDT and the error is TNS:No listener.

tsnames.ora file

# TNSNAMES.ORA Network Configuration File: C:\oracle92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

EXTPROC_CONNECTION_DATA.ISTECH.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

LOCAL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.209)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
)

INST1_HTTP.ISTECH.COM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = agonzalez)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = MODOSE)
(PRESENTATION = http://HRService)
)



listener.ora
# LISTENER.ORA Network Configuration File: C:\oracle92\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.209)(PORT = 1521))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = C:\oracle92)
(SID_NAME = ORCL)
)
)

I have Active SYNC VERSION 4.5
None of the CoreLab OraDirect.NET2 Mobile Samples works in my machine.
The firewall is deactivated
I can ping 127.0.0.1


In conclusion i need to connect from my pdt to oracle and the error is TNS no listener.



thanks for helping me out

Thanks from Panama

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Wed 07 May 2008 10:17

It looks like the problem is in the network
(device network adaptor, emulator network adaptor, network driver).
Try running the Ping sample with:
HOST =192.168.1.209
SID = ORCL
PORT = 1521

As long as the sample does not work correctly, the problem is in the network.

Post Reply