Out of range Error

Gildob

New member
Joined
Jan 9, 2013
Messages
4
Programming Experience
Beginner
I' trying a simple direct insert into a table this is the code:
VB.NET:
 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim VarCommissioni As Decimal = CDec(ImportoLETextBox.Text * "0,3")
        Dim VarImportoEuro As Decimal = CDec(ImportoLETextBox.Text / TextBox1.Text)
        Dim VarImportoLE As Decimal = CDec(ImportoLETextBox)
        MsgBox(ImportoLETextBox.Text & "--" & VarCommissioni & "--" & VarImportoEuro)
        Me.CCRegistTableAdapter.Insert(DataDateTimePicker.Value, RoomTextBox.Text, NumberTextBox.Text, VarImportoLE, VarCommissioni, VarImportoEuro, NomeGuestTextBox.Text, BatchTextBox.Text, AuthcodeTextBox.Text, NoteTextBox.Text)
        Form1.Show()
        Me.Close()

    End Sub
The sql Field type for the 3 VAR is the same (numeric 20,4)
I'm gonna crazy...
If the value of variable VarimportoLE is 4 digit without decimal everythings works if its more than 4 digit VB give me OUT of Range error.......

Someone could me explain why?

Many thanks in advance
 
Back
Top