Solved

How to connect to Oracle and ExecuteOracleScalar in C#

Posted on 2008-06-20
2
1,257 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

15 Experts available now in Live!

Get 1:1 Help Now