473,796 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OleDbDataReader and Currency fields

Greetings!

I have a database created in MS Access that has some fields containing
Currency data. Every time I try to use one of the OleDbDataReader 's
GetXXX() methods to read it, I get an invalid cast exception. Is it
possible to use the OleDbDataReader to get the value of a currency field in
an Access database? If so, how?

Rob, who probably shouldn't even ask this question, since the
OleDbDataReader is too simplistic. I should probably find whatever VB .Net
has that corresponds to my old friend the ADODB.Recordset .
Nov 20 '05 #1
1 2506
Hello Rob

GetDecimal should work for Currency

--
Ibrahim Malluf
http://www.malluf.com
=============== =============== =============== =
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
=============== =============== =============== =
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx

"Rob Richardson" <th*****@n2net. net> wrote in message
news:vv******** ****@corp.super news.com...
Greetings!

I have a database created in MS Access that has some fields containing
Currency data. Every time I try to use one of the OleDbDataReader 's
GetXXX() methods to read it, I get an invalid cast exception. Is it
possible to use the OleDbDataReader to get the value of a currency field in an Access database? If so, how?

Rob, who probably shouldn't even ask this question, since the
OleDbDataReader is too simplistic. I should probably find whatever VB ..Net has that corresponds to my old friend the ADODB.Recordset .

Nov 20 '05 #2

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

Similar topics

1
12301
by: Brandon McCombs | last post by:
hello, I have an app that pops up a custom dialog box and one of the fields for user input is an account balance field. The data gets put into an Object and eventually into an instance of DefaultListModel. When I use getText() on the field I pass it to Double.parseDouble to convert it so I can store it as a number and not a string. When I display it (either in the list or in the dialog box) I want it to be displayed using currency...
2
2301
by: Micromanaged | last post by:
In my response.write line, I need to format a field to be a currency value. Is there a quick and dirty way to do it or is it an involved edit? Here is my code: Response.Write("<td>" & WhataRecordset.Fields.Item(0).Value & "</td><td>" & WhataRecordset.Fields.Item(1).Value & _ "</td><td>" & WhataRecordset.Fields.Item(2).Value & "</td><td>" & WhataRecordset.Fields.Item(3).Value & _ "</td><td>" & WhataRecordset.Fields.Item(4).Value &...
3
13548
by: Melissa | last post by:
I have several fields in my database specified as Currency data type. Is there a way globally to set these fields not to display the dollar sign? Thanks! Melissa
3
3014
by: news.shaw.net | last post by:
I have a subform that contains a currency field. If I tab my way to the field, everything works as desired, a number can be entered, and when I leave the field it is rendered as a currency amount. But if I click on the field with the mouse and enter a number, it shows up like this: 250.00$0.00 with the $0.00 appended to what I type. I have to delete it each time. I've tried a few VBA OnEnter solutions, but nothing has worked so...
1
3821
by: Tom Keane | last post by:
Hi, I need some helpings again! I have a query from one of my tables that gets a total amount of money and gets a percentage from it ie, the field I create in the query is invGSTAmount from a field in my table called invAmount, so I but in the design view of my query: invGSTAmount: *1/11
3
2042
by: Dave Stone | last post by:
This question appeared years ago in the context of Acc2K and SQL Server 7, but no replies were posted. HOWEVER!! It still seems to be a problem with Acc XP and SQL Server 2000. Surely someone has a fix 6 years down the line... I used the Upsizing Wizard to build a SQL database from an Access back-end and link it to the Access f/e. All the data appear to have gone across OK as viewed from Enterprise Manager, but from the front-end all...
2
2870
by: David Nunn | last post by:
Need to preface that I am not much of an Access type. Doing I have several tables that have currency fields, which I run queries against to compare the figures in both. The data is imported from Excel spreadsheets supplied by different parties, over which I have no control. My problem is that whilst several parties supply the spreadsheets with the currency fields containing two figures to the right of the decimal place (ie 123.51,...
0
1379
by: Steve1 via DotNetMonster.com | last post by:
Hi all, I''ve created an OleDbDataReader that will contain the number of records that the used SQL query will return. I'm then using a while loop to loop while the OleDBDataReader object has records. I would like to know does the OleDbDataReader contain the actual information on each record i.e. the fields in the database and their values? Or does the ExecuteReader command only contain the number of records present from the used SQL...
2
3890
by: Ian | last post by:
I have an Access 2000 database written in the UK, this database has many fields set to Currency, I now want to move this database over to a user in the USA but my Currency fields still show the UK £ sign. If I look at these currency fields on my UK PC with it set to regional UK (not USA) then the fields format settings just say Currency, if I then add the USA region to my PC and look at the format again it says: £#,##0.00;-£#,##0.00 I...
0
9684
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10459
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
10236
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
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7552
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
5445
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...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
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

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.