Insert a floating-point value with a culture where a comma (,) is used for "floating point",

I have something like this:

foo { a = 1, b = 2, c = 98,3 }

I generate the insert request dynamically, so in the end:

insert foos(a,b,c) (1, 2, 98,3)

Does anyone know how to do this?

+3
source share
3 answers

The simple answer is: do not use text to insert values ​​first. Use a parameterized SQL query.

- . , " " - . SQL - , , SQL . , SQL- .

, "" ( ) "SQL-", .

SQL, , , - .

+6

SQL .ToString(CultureInfo.InvariantCulture), , TSQL.

, , , .

+1

Can't you just assign a value to something with. ??

Edit: using parameterized queries would be better. And a simple “replacement” will also help.

0
source

Source: https://habr.com/ru/post/1755670/


All Articles