Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / April 2007

Tip: Looking for answers? Try searching our database.

handle rounding at the database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jarm jarm - 30 Apr 2007 19:59 GMT
.Net v1.1 (& im using BDP adonet provider)

The problem:
Im using NUMBER types on an Oracle database. In .Net/C# designer I generate dataadapters and datasets. The designer does pick up the precision and scale correctly and sets the parameters up for the commands. I am using giant WHERE clause style concurrency checking, where every local value is tested against every value on the server in a WHERE clause to detect any change. My numbers are bound to textboxes.

There are two problems.
FIRST the textboxes allow input of any amount of decimal places without regard to precision or scale. I guess I'll have to restrict this myself by doing something in the validating event??

SECOND when the user enters something like 8.5434 that the database is going to round to and store as 8.54, I get a concurrency exception. Because the client code is expecting to see 8.5434 stored on the server. I guess if I fix problem 1, this will go away. But I would have thought the parameter setup would have rounded the number correctly when it forms the sql..?

thanks
Jim Rand - 30 Apr 2007 20:52 GMT
Do you have timestamps available for concurrency checking - much simpler?

UPDATE [AgencyNET].[UrlType] SET [UrlType] = @UrlType, [LastUpdated] =
getutcdate(), [LastUpdatedBy] = @LastUpdatedBy WHERE (([UrlTypeID] =
@Original_UrlTypeID) AND (CAST(TS AS INT) = @Original_TS));SELECT CAST(TS AS
INT) AS TS FROM AgencyNET.UrlType WHERE (UrlTypeID = @UrlTypeID)

> .Net v1.1 (& im using BDP adonet provider)
>
[quoted text clipped - 21 lines]
> ---
> Posted via DotNetSlackers.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.