473,416 Members | 1,737 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,416 software developers and data experts.

Cannot enter scientific notation into text box bound to strongly typed dataset

I am working on an application that requires working with numbers in
scientific notation. I am using SqlServer as the database and I have
created strongly typed data adapters and datasets. The numbers are
defined as numeric in the SqlServer Database and are bound to text
boxes in the app. In the dataset xml these numbers are defined as
decimal. I am using the binding method Format to display the data in
scientific notation and Parse to convert back to numeric before posting
to the database. This all works just fine until you try to enter
scientific notation into the text box directly. In other words,
entering 1230000000 is OK and parses to 1.23e+009 and is posted to the
DB as 1230000000. But if you try to enter 1.23e+009 into the text box
directly it gets rejected (blanked out) or reverts to the previous
entry. I have found this to be normal text box behavior when using
strongly typed datasets where you try to enter a value that is invalid
for the data type specified in the dataset. For example, entering an
invalid date into a text box bound to a date column does the same
thing. This behavior is initiated before any validation events have a
chance of firing and seems to be something I cannot control. One thing
I tried was setting the causes validation property to false on the text
box. This allows me to enter anything I want but also disables the
Format/Parse methods. So, my question is, can anybody tell me how I can
set up the text boxes to accept direct input of scientific notation so
the users can enter 1.23e9 or 1.23e+9 or 1.23e+009 or 1230000000? What
is most irritating is that in the same app I have datagrids with
datagrid text boxes that accept the same scientific numbers and have no
issue formatting or parsing these numbers without any special handling
or method calls. So in a datagrid text box I can enter 1.23e9, 1.23e+9,
1230000000 and it parses and posts it all just fine. This type of
inconsistant behavior drives me and the users crazy.

Nov 17 '05 #1
0 1659

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

Similar topics

0
by: | last post by:
We have an object factory that returns weakly typed datasets (just plain ol' DataSet's). I need to cast it, or transform it, or map it to a strongly typed dataset. There's an old adage I heard...
1
by: Job Lot | last post by:
I am confused how strongly typed dataset is different from un-typed dataset. Is there any good link explaining pros and cons of both? Which one should be used preferably?
2
by: David | last post by:
I have been developing applications with Java for quite a while but I am new to .NET development. I am trying to learn the ".NET way" of creating Strongly Typed Objects from a database. The...
1
by: HardBap | last post by:
I've created a strongly typed DataSet (Customers.xsd) using the xsd.exe tool. I want to be able to access fields using ds.Customer.CompanyName. The problem is when I return this DataSet from a...
2
by: Steve Franks | last post by:
I am trying to access strongly typed properties in a page's master page from the content page. I followed an article that describes how to do this, and it seems quite straight forward. However...
0
by: nina98765 | last post by:
Hi all I have a data-bound Windows form bound to a strongly-typed dataset. Upon opening the form, I would like to Find a specific record based on a parameter I've passed to the form, and display...
2
by: rSmoke | last post by:
I have a DataSet that contains a table with about 6 columns of high accuracy decimal values. When I try to write out the DataSet using the WriteXML() function the XML is written fine, but the...
3
by: MLH | last post by:
Textbox on report displays year (1991) in scientific notation if I raise the font size in that control to above 16 points. It seems Access 'thinks' 1991 is too big to display properly in the...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
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
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
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...
0
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...
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,...
0
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...

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.