I have a .net application written in C# that basically takes a name input by the user and will return results matching that input from a my sql database. The problem I am having is returning results from the string input by the user.
The code is below but the problem section is really just:
WHERE (LastName LIKE '%?Name%')
I have tried tons of permutations of the like statement but with no luck. Any ideas?
<asp:SqlDataSource ID="mdSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionStringMED %>"
ProviderName="<%$ ConnectionStrings:ConnectionStringMED.ProviderName %>"
SelectCommand="SELECT LastName, FirstName, MiddleName, AddressLine1, AddressLine2, City FROM patient WHERE (LastName LIKE '%?Name%') ORDER BY LastName, FirstName">
<asp:ControlParameter ControlID="participantTextBox" Name="Name"
PropertyName="Text" Type="String" />