Hi there I got this query string I have to run so I can update a distinct row in a sql server table:
servidorSql.ConnectionString = conexao
Dim insert As String = "UPDATE [Equipamentos] SET [ID_Cliente]=@ID_Cliente, [Identificacao] = @Identificacao, [Fabricante] = @Fabricante, [Modelo] = @Modelo, [Versao_Software] = @Versao_Software, [Localizacao] = @Localizacao WHERE [ID_Equipamento]=@ID_Equipamento"
Dim sqlquery As SqlCommand = New SqlCommand(insert, servidorSql)
Try
servidorSql.Open()
sqlquery.Parameters.AddWithValue("@ID_Cliente", ID_Cliente)
sqlquery.Parameters.AddWithValue("@ID_Equipamento", ID_Equipamento)
sqlquery.Parameters.AddWithValue("@Identificacao", Identificacao)
sqlquery.Parameters.AddWithValue("@Fabricante", Fabricante)
sqlquery.Parameters.AddWithValue("@modelo", modelo)
sqlquery.Parameters.AddWithValue("@versao_Software", versao_Software)
sqlquery.Parameters.AddWithValue("@localizacao", localizacao)
sqlquery.ExecuteNonQuery()
servidorSql.Close()
Catch e As SqlClient.SqlException
MsgBox(e.ToString())
End Try
The problem is that it doens't do anything, it doesn't update the table and it doesn't give me any exception. "ID_Equipamento" is key and identity of the table and I've tried to run the query with the field being update or not, and it's the same. Any suggestion?