Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Deve dichiarare la variabile scalare @Id?

Devi effettivamente passare un parametro:

command.CommandText = "SELECT * FROM CUSTOMER WHERE Id = @Id;";
command.Parameters.Add("@Id", SqlDbType.Int).Value = Id;
var reader = command.ExecuteReader();