I am new to web services and I have written some simple queries. They work just fine, but this one doesn't return json
SqlDataReader dr;
SqlCommand cmd = new SqlCommand("SELECT * FROM doctors WHERE address LIKE %@add%", conn);
cmd.Parameters.AddWithValue("@add", address);
dr = cmd.ExecuteReader();
If I type it like
"select * from doctors WHERE address = @add
it works fine
What seems to be the problem?
like '%' + @add + '%'@addis a parameter. The OP needs to do what Alex has.addressbefore creating the parameter.address? Is it a string or an object?