Quantcast
Channel: Visual Basic Tips and Tricks
Viewing all articles
Browse latest Browse all 2212

OleDbCommand - Parametro Numerico con Decimale

$
0
0

Buona sera a tutti,

ho un problema con numeri con decimali.

(non badate al nome della function)

Parametro della command

.Add("@IMPORTO", OleDbType.Decimal).Value = TryDouble(item.SubItems.Item(2).Text)

- - - - - 

Public Function TryDouble(ByVal dInput As String, Optional ByVal dOut As Double = 0) As Decimal
        If Decimal.TryParse(dInput, NumberStyles.Any, CultureInfo.CurrentCulture, dOut) Then
            TryDouble = dOut
        End If
    End Function

- - - - - 

TextBox: 23,23 (virgola)

La funzione restituisce 23.23 (punto)

sul DB memorizza 2323 (senza separatore)

Sfruttando .AddWithValue("@IMPORTO",funzione) il dato veniva memorizzato correttamente

Dove sbaglio ?

Pur Mettedo OleDyType.Numeric la situazione non cambia

Grazie


Viewing all articles
Browse latest Browse all 2212

Trending Articles


HOY PANGIT, MAGBAYAD KA!


Henry el monstruo feliz para colorear e imprimir


Dama y vagabundo para pintar


Girasoles para colorear


Good Morning Quotes


RE: Mutton Pies (jameskoiman)


Hagibis (1946) by Francisco V. Coching


Ka riam ka beit bad ka por riam


Vimeo Create - Video Maker & Editor 1.6.0 by Vimeo Inc


Vimeo 3.42.1 by Vimeo Inc