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