Dim SQL As String = "SELECT * FROM HISTORY_GPSPOS;"
conn.ConnectionString = My.Settings.BOAConnectionString.ToString()
Dim insertcommand2 As New OleDbCommand(SQL, conn)
Eh beh, da una più attenta analisi
Penso che la differenza tra Add e AddWithValue si possa racchiudere con questa considerazione che ho trovato in rete:
The advantage is the implicit conversion, but it's also the disadvantage, since the conversion may not be optimal. Maybe your SQL statement or SP expects a certain string parameter to be a char(10) or a varchar(20), but AddWithValue will send it as nvarchar(length of string). This can cause implicit casting/conversion in the DBMS, which can be a real performance hog.
codice:
Cmd.Parameters.Add("@" & NomeCampo, TipoCampo).Value = ValoreRecord
codice:
insertcommand2.Parameters.AddWithValue("@GPSPOS_LATDIR", "Prova")
Attendiamo comunque considerazioni da qualcuno più esperto.