I
Ian R via DotNetMonster.com
I've only just started ADO.NET and I'm wondering if I'm missing a key concept
when trying to insert real data into my database.
The problem is that the CommandText property insists on converting the
decimal places of real data into commas. Take the following code for example:
*-------------------------------*
Dim SqlCommand As System.Data.SQLClient.SqlCommand
SqlCommand = New System.Data.SQLClient.SqlCommand
SqlCommand.Connection = SqlConnection
SqlCommand.CommandText = "INSERT INTO MyTable VALUES (" & 1.7 & ", " & 5.36 &
")"
SqlCommand.ExecuteNonQuery()
*-------------------------------*
The actual value of CommandText then becomes:
"INSERT INTO MyTable VALUES (1,7, 5,36)"
I'd be immensly grateful for any advice on how to use real numbers correctly.
Thanks in advance,
Ian
when trying to insert real data into my database.
The problem is that the CommandText property insists on converting the
decimal places of real data into commas. Take the following code for example:
*-------------------------------*
Dim SqlCommand As System.Data.SQLClient.SqlCommand
SqlCommand = New System.Data.SQLClient.SqlCommand
SqlCommand.Connection = SqlConnection
SqlCommand.CommandText = "INSERT INTO MyTable VALUES (" & 1.7 & ", " & 5.36 &
")"
SqlCommand.ExecuteNonQuery()
*-------------------------------*
The actual value of CommandText then becomes:
"INSERT INTO MyTable VALUES (1,7, 5,36)"
I'd be immensly grateful for any advice on how to use real numbers correctly.
Thanks in advance,
Ian