The fastest way is to not allow the user to enter any unacceptable character in the text field.
You can do that with several methods:
a) Use a masked text field to enter the right value (IE: 99999,99) .
b) Prevent the user to enter invalid characters, capturing, evaluating and discarding those not acceptable.
To do so, you must enable the form to 'preview' the typed Keys by setting the KeyPreview to true in the forms properties.
Then capture the textbox KeyPress event and set the handled property of the System.Windows.Forms.KeyPressEventArgs to true, so the system will ignore this char and prevent it to be entrered in the text box. IE:
Select Case e.KeyChar
Case "1"c, "2"c, ...., "9"c, System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.CurrencyDecimalSeparator.Chars(0) ' Instead of accepting the comma you can select to accept the decimal separator char defined on the System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.CurrencyDecimalSeparator for multilanguage purposes
IF textBox1.txt.IndexOf(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.CurrencyDecimalSeparator)<>-1 then ' Only one comma will be accepted.
e.Handled = True
end if
Case Else
e.Handled = True
End select
Any way, once you have the right TextBox1.Text, you must revamp you SQL sentence like
"Insert INTO Test (money) VALUES (" & TextBox1.Text.Replace(System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.CurrencyDecimalSeparator, "."c) & ")"
This way you can be confident that the decimal separator sent to MySQL is the ".".
Hope this helps