Results 1 to 2 of 2

Thread: Ora-12154,tns Names Could Not Resolve Service Name

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    india
    Posts
    418

    Ora-12154,tns Names Could Not Resolve Service Name

    hi,
    can any one help me to overcome this error.this error occur at myconnection.open()

    <%@ 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>

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    You need add the Oracle database connection to your tnsnames.ora file.

    Are you sure you wanted an Oracle connection (MSDAORA)??
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width