Your `whatever%` and `%whatever` explanations are backwards. `whatever%` is looking for a string that starts with `whatever`, and `%whatever` is looking for a string that ends with `whatever`.
– SiyualMay 05 '16 at 20:59
I am trying to pull data from a Canadian database that I have. If customer enters A0K in my text box, there are many A0K in the column such as A0K 1A0, A0K 1B0 etc...
– MasoudMay 05 '16 at 21:08
SELECT [Province], [Zone], [Degree], [UValueMetric], [UValueEnglish], [EnergyRating] FROM [PostalCode] WHERE ([PostalCode] LIKE '%@PostalCode%')
– MasoudMay 05 '16 at 21:09
I don't know asp.net, but judging from this answer here http://stackoverflow.com/questions/15893098/asp-net-sqldatasource-like-on-selectcommand, it seems correct. It should be just some quotes issue. I can't help anymore. Sorry.
– Nelson TeixeiraMay 05 '16 at 21:26
When you run debugging, what is the exception message? It seems basic matter of usage. The key must be in the exception message. My instant little tip is to avoid same name when making a parameter.
– Kay LeeMay 06 '16 at 00:06
Figured it out, in asp.net you will pass on the % using the control name then + %. Thank you all for your help.
– MasoudMay 06 '16 at 13:26