G
Guest
I am using the following select statement in a web app where I take the cvalue in a text box and conduct a search of the database.
"Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'";
I want to search the text box to see if it contains % and if it does I want to use like in the select statement above instead of =.
It should look something like this:
if (programText.Text contains '%')
{
"Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'";
}
else
{
"Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'";
}
How do I need to alter this code?
Thanks,
Dave
"Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'";
I want to search the text box to see if it contains % and if it does I want to use like in the select statement above instead of =.
It should look something like this:
if (programText.Text contains '%')
{
"Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'";
}
else
{
"Select wo18 from workorder where wo9 = " + "'" + programText.Text + "'";
}
How do I need to alter this code?
Thanks,
Dave