Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

  • 2 years later...
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...