Culture="auto" and SQL Server issues

  • Thread starter Thread starter PL
  • Start date Start date
P

PL

The Culture="auto" UICulture="auto" is a great idea, but how do you handle the situaion
where SQL Server always requires a dot "." in numeric values.

If I use Culture="auto"so that dates and numbers are formatted depending on the
browser settings I will encounter situations where values come in as for example "52,50"
using a comma instead of a dot.

I could go over the whole site and make sure I replace any commas with dots before
passing it along to the queries/sp's but that's a huge job, someone at MS must have thought
about this situation (I hope).

PL.
 
This shouldn't be an issue if you cast the data to its appropriate numeric
type and using parameterized commands. If you're simply concatenating
string values into SQL statements, then you're setting yourself up for far
worse problems than simple format misinterpretation since your code will be
wide open to SQL injection attacks.
 
Back
Top