Author: Learn4Develop | Posted on: 10/4/2009 7:48:08 AM | Views : 267

Hi
   I am developing a web page, where search is based on 3 text boxes, textbox1, textbox2 and textbox3.
I want,
If user enter value in any one textbox (textbox1 or textbox2 or textbox3), it should search the record. If user enters value in any two textboxes, should display value from database. And if users enter value into all three text box it should display value. I have the following code but it seems not right. Could anyone suggest what conditions should used
If (textbox1.text != "" && textbox2.text =="" && textbox3.text =="") { Comm = ("select * from Employee Where ID =@textbox1.text", conn); } Else if (textbox1.text == "" && textbox2.text !="" && textbox3.text =="") { Comm = ("select * from Employee Where PersonID =@textbox2.text", conn); } Else if ...

Go to the complete details ...