PC Review


Reply
Thread Tools Rate Thread

connect to Oracle server by using csharp

 
 
blackdog
Guest
Posts: n/a
 
      13th Jul 2006
I have Oracle client in my system, like to use csharp to communicate
with Oracle server to
retrieve data.
I am very new in csharp, would anyone please give me an example codes
or web pointer.
thanks a lot.

 
Reply With Quote
 
 
 
 
Carl Daniel [VC++ MVP]
Guest
Posts: n/a
 
      13th Jul 2006
blackdog wrote:
> I have Oracle client in my system, like to use csharp to communicate
> with Oracle server to
> retrieve data.
> I am very new in csharp, would anyone please give me an example codes
> or web pointer.
> thanks a lot.


using System.Data;
using System.Data.OracleClient;

class Program
{
pulic static void Main()
{
using (OracleConnection con = new OracleConnection("your connection
string here"))
{
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "select something from some database";
using (OracleDataReader rdr = cmd.ExecuteReader())
{
if (rdr.Read())
// ... read some data
}
}
}
}

http://msdn2.microsoft.com/en-us/lib...cleclient.aspx

You have to use .NET 1.1 or 2.0 to use OracleClient, otherwise you can use
System.Data.OleDb if you have to use .NET 1.0. You have to install the
Oracle client tools on the machine that will access the oracle server.

-cd


 
Reply With Quote
 
Adam Clauss
Guest
Posts: n/a
 
      13th Jul 2006
http://www.google.com/search?q=C%23+oracle

http://www.oracle.com/technology/pub...ok_dotnet.html

--
Adam Clauss

"blackdog" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have Oracle client in my system, like to use csharp to communicate
> with Oracle server to
> retrieve data.
> I am very new in csharp, would anyone please give me an example codes
> or web pointer.
> thanks a lot.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to connect to the Oracle server from Microsoft Access James Microsoft Access Forms 1 20th Apr 2009 06:03 PM
How to connect to Oracle server from within microsoft access James Microsoft Access Forms 1 11th Apr 2009 04:33 PM
Connect to MSSQL Server and Oracle Server =?Utf-8?B?c3lzdGVtc3BlY2lhbGlzdA==?= Microsoft Dot NET Compact Framework 2 9th Mar 2004 03:03 PM
help:my db server is oracle based on unix box, how could i use sql server ce to connect it? stone zou Microsoft Dot NET Compact Framework 5 25th Nov 2003 05:54 AM
connect to an oracle server Bill Li Microsoft Excel Programming 0 14th Aug 2003 04:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 AM.