?
Solved

ADO.Net and Oracle

Posted on 2004-11-15
3
Medium Priority
?
254 Views
Last Modified: 2010-04-15
Hi

  Could someone advice me on how I could open a connection to an Oracle database and excute a SQL statement using OleDb namespace. (ex: select)

Any help is greatly appreciated.
Thanks
0
Comment
Question by:b3cf
1 Comment
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 12589202
Hello

  It's the same like any database that has OleDb drivers

Here's a sample, not tested cuz i don't have oracle installed in my current computer, but this should help you

OleDbConnection cn = new OleDbConnection("provider=msdaora;user
id=scott;password=tiger;data source=OraServer;");

OleDbCommand cmd = new OleDbCommand("Select * from emp",cn);

OleDbReader dr;

dr = cmd.ExecuteReader;

// place ur code

dr.Close;
cn.Close;

for more info look at these articles

http://support.microsoft.com/kb/308448/EN-US/
http://support.microsoft.com/kb/310101/EN-US/
http://www.c-sharpcorner.com/Code/2003/Dec/OracleConnectivityInNet.asp

HTH

Regards,
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question