connecting to Oracle from ASP.NET 2.0 ?

J

jobs

I am able to access 9i and 10g Oracle DBs from other clients on my pc
- sqlplus, PLSQL Developer, etc.

As a simple test I just wanted to connect and access the same oracle
DBs through ASP.NET on my same client ...

my web config connection entry looks like this (somebody elsewhere
said this was working for them):

<add name="pp2" connectionString="user id=xxx;password=xxx;data
source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xx.xx.xxx.xxx)
(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=myservicenamet)))"/>

This asp.net code :

<asp:GridView ID="GridView1" runat="server" DataSourceID="pp2Source">

<Columns>

<asp:BoundField DataField="yyyy" HeaderText="" SortExpression="" />

</Columns>

</asp:GridView>

<asp:SqlDataSource ID="pp2source" runat="server" ConnectionString="<%$
ConnectionStrings:pp2 %>"

selectcommand="select * from xxxx" >

</asp:SqlDataSource>



produces this error:

An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)


Just to make sure, I remove the block of code and the page works fine.
Note SQL Server messages, though trying to connect to Oracle. Also,
wondering if I need to identify a provider type??

I've double checked that the connection string, user and password
match what I test with from other clients and the tnsnames. I also
tried the entry without all the tns stuff.



Thank you for any help or information!
 
G

Guest

I am able to access 9i and 10g Oracle DBs from other clients on my pc
- sqlplus, PLSQL Developer, etc.

As a simple test I just wanted to connect and access the same oracle
DBs through ASP.NET on my same client ...

my web config connection entry looks like this (somebody elsewhere
said this was working for them):

<add name="pp2" connectionString="user id=xxx;password=xxx;data
source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xx.xx.xxx.xxx)
(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=myservicenamet)))"/>

This asp.net code :

<asp:GridView ID="GridView1" runat="server" DataSourceID="pp2Source">

<Columns>

<asp:BoundField DataField="yyyy" HeaderText="" SortExpression="" />

</Columns>

</asp:GridView>

<asp:SqlDataSource ID="pp2source" runat="server" ConnectionString="<%$
ConnectionStrings:pp2 %>"

selectcommand="select * from xxxx" >

</asp:SqlDataSource>

produces this error:

An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)

Just to make sure, I remove the block of code and the page works fine.
Note SQL Server messages, though trying to connect to Oracle. Also,
wondering if I need to identify a provider type??

I've double checked that the connection string, user and password
match what I test with from other clients and the tnsnames. I also
tried the entry without all the tns stuff.

Thank you for any help or information!

I think connection string is wrong.

Anyhow, please check this article at first
http://msdn2.microsoft.com/en-us/library/92ceczx1.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top