Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Going to next page
Message
From
09/10/2009 18:10:27
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01427461
Message ID:
01428595
Views:
31
>>>>>
>>>>>BTW, did you try in MySQL directly
>>>>>
>>>>>
select * from MyTable where myField like '%t%'
?
>>>>
>>>>Yes, of course. And of course it works.
>>>>
>>>>The problem is that MySql seems to be getting
>>>>select * from myTable where myField LIKE '% '+ 't' + '%')' at line 1
>>>
>>>Ok, I understood it and already suggested a workaround. Use select * from myTable where myField like ? and set your parameter in the Selecting event.
>>
>>Sorry about being so dense but what code should I use to set the parameter in the Selecting event?
>
>e.Command.Parameters('Resource').Value = '%' + txtCustomer.Text + '%'

I can see SqlDataSource1_Selecting executing when the form starts. However, when I put something in the textbox, this method doesn't get called. I tried putting
SqlDataSource1_Selecting(sender, e )
in the textbox_TextChanged method, but this results in an error about being unable to cast into System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs.

Assuming that I should be calling the Selecting event from the textbox, what arguements should I be providing? If the assumption is incorrect, how do I call the Selecting event when I exit the textbox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform