V
Vayse
I never realised before that parameter order is important. It was only I was
posting another message in this newsgroup that I realised it.
Has it always been this way?
As in this will work:
Using connAsset As New OleDbConnection(My.Settings.AssetsConnectionString)
connAsset.Open()
Dim stSQL As String = "UPDATE Assets SET StatusID = ? WHERE (AssetCode = ?)"
Dim commandAsset As New OleDbCommand(stSQL, connAsset)
commandAsset.Parameters.Add("@StatusID", OleDbType.VarChar, 1).Value =
conSTATUS_DISPOSED
commandAsset.Parameters.Add("@AssetCode", OleDbType.VarChar, 10).Value =
stAssetCode
But this won't update the row. No error message, it just doesn't update the
row.
commandAsset.Parameters.Add("@AssetCode", OleDbType.VarChar, 10).Value =
stAssetCode
commandAsset.Parameters.Add("@StatusID", OleDbType.VarChar, 1).Value =
conSTATUS_DISPOSED
Don't know how this never came up before, I guess I always just added the
parameters in order.
Hmmm.
Vayse
posting another message in this newsgroup that I realised it.
Has it always been this way?
As in this will work:
Using connAsset As New OleDbConnection(My.Settings.AssetsConnectionString)
connAsset.Open()
Dim stSQL As String = "UPDATE Assets SET StatusID = ? WHERE (AssetCode = ?)"
Dim commandAsset As New OleDbCommand(stSQL, connAsset)
commandAsset.Parameters.Add("@StatusID", OleDbType.VarChar, 1).Value =
conSTATUS_DISPOSED
commandAsset.Parameters.Add("@AssetCode", OleDbType.VarChar, 10).Value =
stAssetCode
But this won't update the row. No error message, it just doesn't update the
row.
commandAsset.Parameters.Add("@AssetCode", OleDbType.VarChar, 10).Value =
stAssetCode
commandAsset.Parameters.Add("@StatusID", OleDbType.VarChar, 1).Value =
conSTATUS_DISPOSED
Don't know how this never came up before, I guess I always just added the
parameters in order.
Hmmm.
Vayse