The user can enter criteria in only 1 text box, or in multiple text boxes. Based on this, I need to create the query to go to 1, 2, or more tables depending on the criteria entered.
I'm thinking of just creating a big string and adding to it as necessary if the text box is not blank.
Is this the best way to go about this?Try reading this article by Scott Mitchell. It'll be a good starting point:
http://www.4guysfromrolla.com/webtech/010704-1.shtml
If you have to create dynamic queries, be very very careful about Sql Injection Attacks.
Whenever possible, use Parameter objects.
0 comments:
Post a Comment