Strange variable convertion...
-
Hi! Please take a look at this code... Public Sub GravaConfiguracao_Fideliza(ByVal intESC As Integer, ByVal dblVE As intPE As Integer) Dim strInsert As String = "Insert Into Configuracao (Escalao, ValorEscalao, PontosEscalao) Values (" & intESC & ", " & dblVE & ", " & intPE & ")" Please note the variable dblVE. It is a Double variable. If it's value is for instance 0.5 when the strInsert string is created the dblVE variable is converted to 0,5 and then SQL Server reports an error because in the end the string is created with 3 fields and "4" values... Can anyone help me with this? TIA Jorge
-
Hi! Please take a look at this code... Public Sub GravaConfiguracao_Fideliza(ByVal intESC As Integer, ByVal dblVE As intPE As Integer) Dim strInsert As String = "Insert Into Configuracao (Escalao, ValorEscalao, PontosEscalao) Values (" & intESC & ", " & dblVE & ", " & intPE & ")" Please note the variable dblVE. It is a Double variable. If it's value is for instance 0.5 when the strInsert string is created the dblVE variable is converted to 0,5 and then SQL Server reports an error because in the end the string is created with 3 fields and "4" values... Can anyone help me with this? TIA Jorge
-
ei, Public Sub GravaConfiguracao_Fideliza(ByVal intESC As Integer, ByVal dblVE
As
intPEAs
Integer) can you tell what this parameter declaration mean. if confused about the doubleAS
is that a valid statement?GUERVEN Xuriuxs
Hi! I'm sorry about the mistaken code... The correct one is as follows: Public Sub GravaConfiguracao_Fideliza(ByVal intESC As Integer, ByVal dblVE As Double, ByVal intPE As Integer) Dim strInsert As String = "Insert Into Configuracao (Escalao, ValorEscalao, PontosEscalao) Values (" & intESC & ", " & dblVE & ", " & intPE & ")" Thnaks Jorge
-
Hi! Please take a look at this code... Public Sub GravaConfiguracao_Fideliza(ByVal intESC As Integer, ByVal dblVE As intPE As Integer) Dim strInsert As String = "Insert Into Configuracao (Escalao, ValorEscalao, PontosEscalao) Values (" & intESC & ", " & dblVE & ", " & intPE & ")" Please note the variable dblVE. It is a Double variable. If it's value is for instance 0.5 when the strInsert string is created the dblVE variable is converted to 0,5 and then SQL Server reports an error because in the end the string is created with 3 fields and "4" values... Can anyone help me with this? TIA Jorge
Use the ToString method to convert the value instead of using implicit conversion. Then you can specify a culture or format provider. Use CultureInfo.InvariantCulture or NumberFormatInfo.InvariantInfo to get a format that uses decimal period.
--- b { font-weight: normal; }
-
Use the ToString method to convert the value instead of using implicit conversion. Then you can specify a culture or format provider. Use CultureInfo.InvariantCulture or NumberFormatInfo.InvariantInfo to get a format that uses decimal period.
--- b { font-weight: normal; }