Solved

How to connect to Oracle and ExecuteOracleScalar in C#

Posted on 2008-06-20
2
1,260 Views
Last Modified: 2010-04-21
Well, once again C# just gets me in a tizzy.  Forgive me but I am used to VB.NET.  How in God's name do I create an Oracle connection and then ExecuteOracleScalar?  I've googled about 100 pages and have not found one example.  Nor is it in MSDN.  Nor is it in the help that comes with Visual Studio.  Apparently, it is 100 percent different from VB.NET.

Thanks in advance.
0
Comment
Question by:jonmclean2
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 21834733
here is some sample code for a OleDBConnection (which can be done with Oracle also) and making a ExecuteScalar() calls
http://www.java2s.com/Tutorial/CSharp/0560__ADO.Net/OleDbCommandExecuteScalar.htm
0
 
LVL 1

Author Closing Comment

by:jonmclean2
ID: 31469317
Ah, thank you.  I was leaving out the cast and also the cmd.Connection = conn;
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now