473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

oracle number field and datareader

How do I select a number field from oracle 9i? The field is a
number(integer). I have this line in my datareader:

double dbid;
dbid = dr.GetDecimal(0);

I have tried getstring, convert and other things but come up with various
exceptions.

Any help is greatly appreciated! I am stuck here over what should be very
simple.

Thanks
Mike
Nov 22 '05 #1
2 2399
Mike - you can use the GetValue in a pinch but I believe the GetInt32 is the
correct translation.

What exceptions are you getting? This is key in knowing what the problem is
b/c if the values are Null in the db - then you can't use Getxxx without
first checking for Is DBNull - this is a common source of problems like this
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
How do I select a number field from oracle 9i? The field is a
number(integer). I have this line in my datareader:

double dbid;
dbid = dr.GetDecimal(0);

I have tried getstring, convert and other things but come up with various
exceptions.

Any help is greatly appreciated! I am stuck here over what should be very
simple.

Thanks
Mike

Nov 22 '05 #2
The GetInt32 did it! Thanks. I guess I hadn't tried that one.

Mike

"W.G. Ryan MVP" wrote:
Mike - you can use the GetValue in a pinch but I believe the GetInt32 is the
correct translation.

What exceptions are you getting? This is key in knowing what the problem is
b/c if the values are Null in the db - then you can't use Getxxx without
first checking for Is DBNull - this is a common source of problems like this
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:E6**********************************@microsof t.com...
How do I select a number field from oracle 9i? The field is a
number(integer). I have this line in my datareader:

double dbid;
dbid = dr.GetDecimal(0);

I have tried getstring, convert and other things but come up with various
exceptions.

Any help is greatly appreciated! I am stuck here over what should be very
simple.

Thanks
Mike


Nov 22 '05 #3

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

Similar topics

2
by: Mike | last post by:
How do I select a number field from oracle 9i? The field is a number(integer). I have this line in my datareader: double dbid; dbid = dr.GetDecimal(0); I have tried getstring, convert and...
3
by: Jon Ole Hedne | last post by:
My Access 2002-application need to work with tables from both Oracle and Access. To solve this, I want to run some querys on three views in Oracle and import the results into temporary...
4
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we...
6
by: robin9876 | last post by:
In an Access 97 (and 2000) database that has linked tables to Oracle which is showing some fields as text when they are numbers in Oracle. In Oracle they are specified to a size e.g. Number(38)....
11
by: Chris Fink | last post by:
I have setup an Oracle table which contains a blob field. How do I insert data into this field using C# and ADO.net?
0
by: mclagett | last post by:
I am being driven absolutely mad. As part of a generic data access library that was originally written on top of Oracle's OCI and Pro-C libraries but that I am now porting to ADO.NET I am trying...
1
by: Ken | last post by:
Hello, I'm trying to read a Blob from Oracle and then write it to an audio file(.AU). I'm using Visual Studio.Net 2003 (VB). I can't seem to get my code to work. Will someone take a look at it...
6
by: JV | last post by:
A ref cursor data type can obviously be returned as an output parameter of a stored procedure, but can an ASP.NET application call an oracle proc that uses a ref cursor as an input parameter? If...
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
14
by: jehugaleahsa | last post by:
Hello: I am working with Oracle .NET Stored Procedures. I would like to know how to return the results of a SELECT statement. I have tried returning a OracleRefCursor and a DataTable, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.