Forum Moderators: open

Message Too Old, No Replies

Select Where Or Or Or

         

ntqb

7:40 pm on Feb 5, 2009 (gmt 0)

10+ Year Member



Can someone tell me how can i filter my results from multiple textboxes in asp.net ?

SELECT * FROM [MyTable] WHERE ([Firstname] = @Firstname) Or ([Lastname] = @Lastname) doesn't work

With one textbox is fine but with multiple texboxes no chance.

Thanks a lot!

LifeinAsia

8:06 pm on Feb 5, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



What exactly is not working? The logic sounds solid.

ntqb

6:46 am on Feb 6, 2009 (gmt 0)

10+ Year Member



im using a gridview to show data from mssql. When im trying to filter data by first name, last name, country is not working.
in classic asp i can use OR in select statement but in asp.net i dont know how.

ntqb

10:47 am on Feb 6, 2009 (gmt 0)

10+ Year Member



i found the solution :) Thanks!

bhonda

1:06 pm on Feb 10, 2009 (gmt 0)

10+ Year Member



Hey,

Well done for getting it sorted. Just for reference though, it may be a good idea to post the solution up here, so if anyone else has the same problem, they can figure it out too!

B