.NETGURU
Connecting to Oracle
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oledb' list.


Deepika_Sharma@concentra.com
C'd anyone send me sample code to connect to oracle from an aspx page. I
have installed the client on my m/c but when i run the foll. code, i get an
error on the conAuthors.Open() statement. It doesn't seem to be finding the
oracle stuff, although when i try to test teh connection from ODBC tester,
it works fine. Whats missing?

Thanks
-deepika

<%@ Import Namespace="System.Data.OleDb" %>
<%
Dim conAuthors As OleDbConnection
Dim cmdSelectAuthors As OleDbCommand
Dim dtrAuthors As OleDbDataReader
response.write("Here are users names")
conAuthors = New OleDbConnection( "PROVIDER=MSDAORA;DATA Source=abc;user
id=user;password=pwd;Persist Security info=False;" )
conAuthors.Open()
cmdSelectAuthors = New OleDbCommand( "Select name From Users", conAuthors )
dtrAuthors = cmdSelectAuthors.ExecuteReader()
While dtrAuthors.Read()
Response.Write( "<li>" )
Response.Write( dtrAuthors( "name" ) )
End While
dtrAuthors.Close()
conAuthors.Close()
%>

****** CONFIDENTIALITY NOTICE ******
THIS E-MAIL, INCLUDING ANY ATTACHED FILES, MAY CONTAIN CONFIDENTIAL AND
PRIVILEGED INFORMATION FOR THE SOLE USE OF THE INTENDED RECIPIENT(S). ANY
REVIEW, USE, DISTRIBUTION, OR DISCLOSURE BY OTHERS IS STRICTLY PROHIBITED.
IF YOU ARE NOT THE INTENDED RECIPIENT (OR AUTHORIZED TO RECEIVE INFORMATION
FOR THE RECIPIENT), PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE
ALL COPIES OF THIS MESSAGE. THANK YOU.

Reply to this message...
 
    
Wally McClure
what error are you getting?

Wally

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Wednesday, March 06, 2002 3:22 PM
To: ngfx-oledb
Subject: [ngfx-oledb] Connecting to Oracle

C'd anyone send me sample code to connect to oracle from an aspx page. I
have installed the client on my m/c but when i run the foll. code, i get an
error on the conAuthors.Open() statement. It doesn't seem to be finding the
oracle stuff, although when i try to test teh connection from ODBC tester,
it works fine. Whats missing?

Thanks
-deepika

<%@ Import Namespace="System.Data.OleDb" %>
<%
Dim conAuthors As OleDbConnection
Dim cmdSelectAuthors As OleDbCommand
Dim dtrAuthors As OleDbDataReader
response.write("Here are users names")
conAuthors = New OleDbConnection( "PROVIDER=MSDAORA;DATA Source=abc;user
id=user;password=pwd;Persist Security info=False;" )
conAuthors.Open()
cmdSelectAuthors = New OleDbCommand( "Select name From Users", conAuthors )
dtrAuthors = cmdSelectAuthors.ExecuteReader()
While dtrAuthors.Read()
Response.Write( "<li>" )
Response.Write( dtrAuthors( "name" ) )
End While
dtrAuthors.Close()
conAuthors.Close()
%>

****** CONFIDENTIALITY NOTICE ******
THIS E-MAIL, INCLUDING ANY ATTACHED FILES, MAY CONTAIN CONFIDENTIAL AND
PRIVILEGED INFORMATION FOR THE SOLE USE OF THE INTENDED RECIPIENT(S). ANY
REVIEW, USE, DISTRIBUTION, OR DISCLOSURE BY OTHERS IS STRICTLY PROHIBITED.
IF YOU ARE NOT THE INTENDED RECIPIENT (OR AUTHORIZED TO RECEIVE INFORMATION
FOR THE RECIPIENT), PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE
ALL COPIES OF THIS MESSAGE. THANK YOU.

| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT

Reply to this message...
 
    
ganesh
Deepika:

Teh connection string should be of the format

"PROVIDER=MSDAORA.1;User ID=; password=;Data Source=<<TNSNAME>>"

Can U check if this is what giving you the erroe?

Ganesh

----- Original Message -----
From: <Click here to reveal e-mail address>
To: "ngfx-oledb" <Click here to reveal e-mail address>
Sent: Wednesday, March 06, 2002 12:22 PM
Subject: [ngfx-oledb] Connecting to Oracle

[Original message clipped]

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

Reply to this message...
 
    
Deepika_Sharma@concentra.com

Thanks for replying but i got it working this morning. I didn't change
anything. Maybe just a rebbot is waht was required.
Thanks
-deepika

ganesh
<ganbhu@yahoo To: ngfx-oledb <Click here to reveal e-mail address>
.com> cc:
Subject: [ngfx-oledb] Re: Connecting to Oracle
03/06/02
07:26 PM
Please
respond to
ngfx-oledb

Deepika:

Teh connection string should be of the format

"PROVIDER=MSDAORA.1;User ID=; password=;Data Source=<<TNSNAME>>"

Can U check if this is what giving you the erroe?

Ganesh

----- Original Message -----
From: <Click here to reveal e-mail address>
To: "ngfx-oledb" <Click here to reveal e-mail address>
Sent: Wednesday, March 06, 2002 12:22 PM
Subject: [ngfx-oledb] Connecting to Oracle

[Original message clipped]

_________________________________________________________

Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT

Reply to this message...
 
    
Deepika_Sharma@concentra.com

Its working now. Thanks. The errror was to the effect that oracle client
needs to be installed ..I guess i just had to reboot.
-deepika

"Wally
McClure" To: ngfx-oledb <Click here to reveal e-mail address>
<wallym@wally cc:
m.com> Subject: [ngfx-oledb] RE: Connecting to Oracle

03/06/02
03:48 PM
Please
respond to
ngfx-oledb

what error are you getting?

Wally

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Wednesday, March 06, 2002 3:22 PM
To: ngfx-oledb
Subject: [ngfx-oledb] Connecting to Oracle

C'd anyone send me sample code to connect to oracle from an aspx page. I
have installed the client on my m/c but when i run the foll. code, i get an
error on the conAuthors.Open() statement. It doesn't seem to be finding the
oracle stuff, although when i try to test teh connection from ODBC tester,
it works fine. Whats missing?

Thanks
-deepika

<%@ Import Namespace="System.Data.OleDb" %>
<%
Dim conAuthors As OleDbConnection
Dim cmdSelectAuthors As OleDbCommand
Dim dtrAuthors As OleDbDataReader
response.write("Here are users names")
conAuthors = New OleDbConnection( "PROVIDER=MSDAORA;DATA Source=abc;user
id=user;password=pwd;Persist Security info=False;" )
conAuthors.Open()
cmdSelectAuthors = New OleDbCommand( "Select name From Users", conAuthors )
dtrAuthors = cmdSelectAuthors.ExecuteReader()
While dtrAuthors.Read()
Response.Write( "<li>" )
Response.Write( dtrAuthors( "name" ) )
End While
dtrAuthors.Close()
conAuthors.Close()
%>

****** CONFIDENTIALITY NOTICE ******
THIS E-MAIL, INCLUDING ANY ATTACHED FILES, MAY CONTAIN CONFIDENTIAL AND
PRIVILEGED INFORMATION FOR THE SOLE USE OF THE INTENDED RECIPIENT(S). ANY
REVIEW, USE, DISTRIBUTION, OR DISCLOSURE BY OTHERS IS STRICTLY PROHIBITED.
IF YOU ARE NOT THE INTENDED RECIPIENT (OR AUTHORIZED TO RECEIVE INFORMATION
FOR THE RECIPIENT), PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE
ALL COPIES OF THIS MESSAGE. THANK YOU.

| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT

| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT

Reply to this message...
 
 
System.Data.OleDb.OleDbCommand
System.Data.OleDb.OleDbConnection
System.Data.OleDb.OleDbDataReader




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification