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 / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Datasync - decimal comparisons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gav - 09 Oct 2007 11:11 GMT
Hi all,

I'm trying to update an SQL database by allowing users to upload a csv file
via webform. I then want to fill a datagrid to show what changes have been
made.

At first I tried using DataSets Merge, however this sets row states to
modified even if the rows are identical (which I didn't want for several
reasons). I changed the code to check for changes in the row... however when
it checks a decimal value the same value does not match! For example 43.5 in
both but if you look closer the lo value of one is 4350 and the other is 435.
I was converting all the objects ToString for comparison so one goes to
"43.50" and the other "43.5".

I'm not sure why it's doing this?! the scale of the decimal in the DB is 2
however when I create the DataTable to hold the csv data, I get the DataType
for the columns from the DataTable populated from the DB, so it should be the
same.

Does anybody have any suggestions for me?

Thanks
Gav
Gav - 09 Oct 2007 15:41 GMT
Ignore that: Object.equals(Object) works as expected..

> Hi all,
>
[quoted text clipped - 19 lines]
> Thanks
> Gav

Rate this thread:







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.