PDA

Click to See Complete Forum and Search --> : **not resolved **Ora-12154,tns Names Could Not Resolve Service Name


jayakumar
Nov 28th, 2002, 09:08 AM
hi,
can any one help me to overcome this error.this error occur at myconnection.open() .i already included oracle connection in tnsnames.ora.but i couldnot get it.in vb6 it is not giving any error with the same dsn name.

<%@ Page %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>

<script runat="server">
public class test
inherits System.Web.UI.Control
Sub Page_Load(Src As Object, E As EventArgs)
Dim myConnString As String = _
"Provider=MSDAORA;Data Source=aspnet;User ID=poms;Password=pomsabc99;"

Dim myConnection As New OleDbConnection(myConnString)
myConnection.Open()
Dim myCommand as new OleDbCommand("select * from t_country_master",myConnection)
dim myReader as OledbDataReader
myReader=myCommand.ExecuteReader()
while myReader.read()
response.write(myReader("country"))
end while
myConnection.Close()
End Sub
end class
</script>
<html>
<head>
</head>
<body>
<ASPataGrid id="MyDataGrid" runat="server"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false"
/>
</body>
</html>

okipwn
Dec 1st, 2002, 11:46 PM
- Makes sure that you've already had Oracle Client installed on your machine.
- Try to ping your Oracle database server, ex : ping aspnet
- If the connection is failed, fix it by changing your IP/Subnet address. The database subnet must be the same with your machine.
- Use Net8 Assistant (Oracle 8i) as a tool for editing your tnsnames.ora, it will be safer and more comfortable :).
- If Net8 track is OK, than your ADO track should be OK too.

robdotnet00
Dec 2nd, 2002, 12:25 PM
it looks like a oracle server error maybe the listner is down or some network problem is causing that error.