help with MySQL dynamic sql
-
I am developing C# winForm application. I have a textbox for searchign customer name but I want the user to enter the customer name like this:
john mathews
Or:
Robert Duff
then in MySQL I want to have a dynamic sql to search search the customer_name like this:
SELECT * FROM customers WHERE customer_name CONTAINS john AND customer_name CONTAINS mathews
-
I am developing C# winForm application. I have a textbox for searchign customer name but I want the user to enter the customer name like this:
john mathews
Or:
Robert Duff
then in MySQL I want to have a dynamic sql to search search the customer_name like this:
SELECT * FROM customers WHERE customer_name CONTAINS john AND customer_name CONTAINS mathews
See the sticky at the top, it tells you how to get an answer to your QUESTION, ou actually need to ask a question rather than make a statement.
Never underestimate the power of human stupidity RAH
-
I am developing C# winForm application. I have a textbox for searchign customer name but I want the user to enter the customer name like this:
john mathews
Or:
Robert Duff
then in MySQL I want to have a dynamic sql to search search the customer_name like this:
SELECT * FROM customers WHERE customer_name CONTAINS john AND customer_name CONTAINS mathews
Get the value of the texbox, split it into a
string[]
and use the elements of the array as parameters into your SQL query. Note, do not use string concatenation to create your query but proper SQL parameterisation.One of these days I'm going to think of a really clever signature.
-
Get the value of the texbox, split it into a
string[]
and use the elements of the array as parameters into your SQL query. Note, do not use string concatenation to create your query but proper SQL parameterisation.One of these days I'm going to think of a really clever signature.
this is in C#.. but can this be done in SQL level?
-
this is in C#.. but can this be done in SQL level?
-
I am developing C# winForm application. I have a textbox for searchign customer name but I want the user to enter the customer name like this:
john mathews
Or:
Robert Duff
then in MySQL I want to have a dynamic sql to search search the customer_name like this:
SELECT * FROM customers WHERE customer_name CONTAINS john AND customer_name CONTAINS mathews