473,770 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Oracle connectivity in C#

can anyone send a code for the oracle connectivity wid C#.. would be
really tahnkful ..
Desert Desperado 8)
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
2 4133
The following code explains how to connect to oracle db and display fetched data into a datagrid :o)

1. Create a winforms project and add a datagrid control on it and call it as datagrid1
2. Add a button control on the form and call it button1.
3. Add a reference to System.Data.Ora cleClient.dll

Then add following lines near the using statements
using System.Data;
using System.Data.Ora cleClient;
Here is the code for fetchind data from oracle table and displaying it in the datagrid when user clicks on the button.

private void button1_Click(o bject sender, System.EventArg s e)
{
try
{
System.Data.Ora cleClient.Oracl eConnection objConn =
new System.Data.Ora cleClient.Oracl eConnection("Da ta Source=<your db service name>;User ID='<user name>'; password='<pass word>'" );
//note that user id and password values are specified in single quotes
objConn.Open();

String strCommand;
strCommand ="Select * from <table name>";
//Create new command object

System.Data.Ora cleClient.Oracl eCommand objCommand = new System.Data.Ora cleClient.Oracl eCommand(strCom mand,objConn);

DataSet ds=new DataSet() ;
System.Data.Ora cleClient.Oracl eDataAdapter objDa = new System.Data.Ora cleClient.Oracl eDataAdapter (objCommand);

objDa.Fill(ds);
dataGrid1.DataS ource = ds;
}
catch(System.Ex ception ex)
{
MessageBox.Show (ex.Message);
}
}

HTH,
Ashutosh

"New Devil" <ib*****@islama bad-dot-net.no-spam.invalid> wrote in message news:40******** **@Usenet.com.. .
can anyone send a code for the oracle connectivity wid C#.. would be
really tahnkful ..
Desert Desperado 8)


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9123
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the database successfully. The problem is that I want to install this application on several Windows 2000 client machines that do not have Oracle client installed (hence missing all the ODBC connectivity support files/drivers). What is the minimum...
2
2651
by: Axel Dachtler | last post by:
I am looking for detailed information about the topic "connectivity" in Oracle 9i including JDBC and CGI. Thank you
1
4040
by: Ton | last post by:
I have a question about connectivity between different databases. Oracle, DB2400 and SQL_server. It is easy to integrate application products that are running on different DB platforms? What products can be used to achieve this? Our consultant is mentioning .NET but then we have to run everything on SQL server. Currently we are running on Oracle but our third party generic applications are first developed for SQL server and later...
1
6273
by: lovkeshanand | last post by:
Dear All, I am using the oracle transparent gateway connectivity with sql server using tg4msql,as far as settings are concerned those were set and Connectivity is working Fine, and getting the response from that server. here is description what I done as:-There is a View on Sqlserver which is Join of 6 tables and have
7
4362
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work. I tried that quickly, but the file is 400 MB, and the the installation asks for all kinds of things in order to install. Now I'm very confused. a) Do you still need ODP.NET with framework 2.0? b) Do you need to download and install other...
9
1770
by: rahul | last post by:
Hello every1 Can any1 tell me that What are teh various methods by which we can connect our database in sql to our project's front end which is in VB ?? I wanna know the pros and cons of various types of Connectivities?
2
7249
by: ahogan | last post by:
Previously posted on comp.databases.oracle.misc. Apologies to those who read both groups. I have created a link using generic connectivity from an Oracle 10.2.0.1 instance running on windows 2003 32 bit server to an AS400/DB2 database (V5R2 AFAIK). I can execute Select, Insert and Delete statements via the link without error. When I launch an update from sqlplus I get the following error:
5
7776
by: Scav | last post by:
Helpful folks, I am having a problem getting Oracle's Transparent Gateway for DRDA product to interface with DB2 UDB for LUW 8.1.14. The Gateway product is running on Linux and using DRDA protocol to connect to my DB2 test server, which is running on Win2003. This test server has recently been migrated to V8. It was previously on V7.2 FP5, and here is where the mystery lies.
4
2158
by: reachravi | last post by:
Hi, In our ASP application, we are using a visual basic Dll file to perform database operations. We have a function in our Dll file for executing stored procedures. This function takes 3 input parameters from ASP
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.