Solved

How to connect to Oracle and ExecuteOracleScalar in C#

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 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