J
jerrylinkinpark
Guest
Hi guys,
I have a complex question regarding how to write sqlcommand. my database has e.g. 5 columns, and I would like to let the user select which column to search and give the result based on the user searched column.
If there is only one column this would be quite easy using "SELECT * FROM mydata.mytable WHERE name='"textBox1->text"'".
But if I have for example 5 columns to define and in case the user can also NOT enter any value in one or more in the 5, the situation becomes more complex... If one would list all possibilities it would be 2 to the power of 5 which 32 situations with 32 possibility of sqlcommands..
So, is there an easy way to do it??
Continue reading...
I have a complex question regarding how to write sqlcommand. my database has e.g. 5 columns, and I would like to let the user select which column to search and give the result based on the user searched column.
If there is only one column this would be quite easy using "SELECT * FROM mydata.mytable WHERE name='"textBox1->text"'".
But if I have for example 5 columns to define and in case the user can also NOT enter any value in one or more in the 5, the situation becomes more complex... If one would list all possibilities it would be 2 to the power of 5 which 32 situations with 32 possibility of sqlcommands..
So, is there an easy way to do it??
Continue reading...