By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,684 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,684 IT Pros & Developers. It's quick & easy.

connecting to Oracle from ASP.NET 2.0 ?

P: n/a
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=x x.xx.xxx.xxx)
(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=myservicen amet)))"/>

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!

Jun 7 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jun 7, 10:26 pm, jobs <j...@webdos.comwrote:
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=x x.xx.xxx.xxx)
(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=myservicen amet)))"/>

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

Jun 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.