Hello I want to remove the last word from my sentence in C#. Here is my query:
\"SELECT * FROM People WHERE City = @City AND County = @County AND\"
>
Multiple methods for fixing the string given already.
This looks like dynamically generated SQL, so, the more sensible solution in my mind is to never have the final AND
there. This can be done by counting the number of parameters you've added to the where
clause, and prepending the and
for every parameter after the first.