Welcome to WebmasterWorld Guest from 18.205.176.85

Forum Moderators: ocean10000

Message Too Old, No Replies

Select Where Or Or Or

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

New User

10+ Year Member

joined:Mar 19, 2008
posts:23
votes: 0


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!

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

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5853
votes: 200


What exactly is not working? The logic sounds solid.
6:46 am on Feb 6, 2009 (gmt 0)

New User

10+ Year Member

joined:Mar 19, 2008
posts:23
votes: 0


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.
10:47 am on Feb 6, 2009 (gmt 0)

New User

10+ Year Member

joined:Mar 19, 2008
posts:23
votes: 0


i found the solution :) Thanks!
1:06 pm on Feb 10, 2009 (gmt 0)

Full Member

10+ Year Member

joined:June 29, 2005
posts:216
votes: 0


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