G
Guest
doing some research on regional settings, .Net & DB
I put my machine in Germany(Germany)
thus the decimal char = ","
the seperator char = "."
so I set up the database for a test in .Net
I'm using Access.
a field (double) contains 45,56
I read the record using DataReader
then I did a read:
mVariable = .GetDouble(TheOrdinalPos)
mVariable shows "45.56" which means the comma got translate to the period.
on the Update, myActionQuery is.......
myActionQuery = "UPDATE Table1 SET Fld1 = " & mVariable & " Where Id = " & Id
....................
myCommand.CommandText = myActionQuery
myActionQuery shows
"UPDATE Table1 SET Fld1 = 45,56 Where Id = 10"
notice the 45.56 was turned into 45,56 (that's with a comma for the
decimal character)
but on the actual execute command,
numOfRecordsUpdated = myCommand.ExecuteNonQuery()
it caused a trap.... invalid statement
but when I changed from Germany to English and reran the code, with no code
changes, same scenario
the UPDATE worked...
I am obviously missing something dealing with Regional setting... can some
one fill me in?
I put my machine in Germany(Germany)
thus the decimal char = ","
the seperator char = "."
so I set up the database for a test in .Net
I'm using Access.
a field (double) contains 45,56
I read the record using DataReader
then I did a read:
mVariable = .GetDouble(TheOrdinalPos)
mVariable shows "45.56" which means the comma got translate to the period.
on the Update, myActionQuery is.......
myActionQuery = "UPDATE Table1 SET Fld1 = " & mVariable & " Where Id = " & Id
....................
myCommand.CommandText = myActionQuery
myActionQuery shows
"UPDATE Table1 SET Fld1 = 45,56 Where Id = 10"
notice the 45.56 was turned into 45,56 (that's with a comma for the
decimal character)
but on the actual execute command,
numOfRecordsUpdated = myCommand.ExecuteNonQuery()
it caused a trap.... invalid statement
but when I changed from Germany to English and reran the code, with no code
changes, same scenario
the UPDATE worked...
I am obviously missing something dealing with Regional setting... can some
one fill me in?