MikeP Posted January 12, 2004 Posted January 12, 2004 I'd like to create a databound custom control that I can pass a parameter to in order to filter its dataset. The scenario is as follows: I'd create a generic StudentInfo control that would display Name, Address, and Phone Number from the Student Info table. This generic StudentInfo control would include a dataset using SQL like "Select * from Student Info". The form that contains the StudentInfo control would then pass it an SSN, upon which it would filter the data and only display the info for that particular SSN. Sounds like a simple task, yet I'm having some difficulties. Anybody want to have a go? Cheers! Quote
nsadowy Posted April 22, 2006 Posted April 22, 2006 I am in a similar situation. I have an SQL database to which I would like to provide a search page. I have various form fields that I use to figure out what the user is looking for. From that I can construct a valid SQL select statement with appropriate "WHERE" clauses. I can easily display the full data using a GridView control. I am pulling the information from the SQL database with an SQLDataSource. How can I programatically apply my WHERE clause to either the selectcommand or filtercommand? I have tried setting the selectcommand to an appropriate select statment, and I have tried setting the filtercommand to an appropriate filter, but the GridView continues to show all of the data. HELP! I'm pulling my hair out on this one. Nick Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.