Datasync - decimal comparisons

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top