ciao a tutti
ERRORE:
"Violazione di concorrenza: UpdateCommand ha modificato 0 record."
nn riesco a capire dove sbaglio
codice:
Dim cmd As SqlCommand = New SqlCommand("SELECT * FROM TAB1", con)
Dim cmdUp as new SqlCommand
cmdUP.Connection = con
cmdUp.CommandText = "UPDATE TAB1 SET campo1=@cp1,ora=GETDATE() WHERE campo2='@cp2' "
cmdUp.Parameters.Add(New SqlParameter("@cp1", SqlDbType.Int, 2, ParameterDirection.Input, False, 0, 0, "campo1", DataRowVersion.Current, Nothing))
cmdUp.Parameters.Add(New SqlParameter("@cp2", SqlDbType.NVarChar, 50, ParameterDirection.Input, False, 0, 0, "campo2", DataRowVersion.Original, Nothing))
Dim daS = New SqlDataAdapter(cmd)
daS.UpdateCommand = cmdUP
daS.Fill(dtTest)
'compie le varie modifiche sul mio datatable
'....
Try
daS.Update(dtTest)
Catch ex as Exception
Console.WriteLine(ex.Message)
End Try