Solved

Searching with codebehind and object datasource

Posted on 2006-06-30
2
327 Views
Last Modified: 2012-05-05
Hello experts,

I am binding a datalist control to an object datasource...

However, users need to be able to filter their search once the page loads.

I have 7 fields of data they can use to file, four dropdown lists, two checkboxes and a textfield....

Once they have selected all their filter search criteria (which could be one all or anything in between), I need to perform the search and rebing the new result to the datalist control.


1. How do I go about doing this?
2. Is this at all possible to do whilst untilisng an object datasource...
3.If so, how do I go about it
4. do i use the form field criteria of the object datasource and if so, how does that work, baring in mind that am using a datalist control


Many Thanks,

Clara
           
 
0
Comment
Question by:claracruz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Author Comment

by:claracruz
ID: 17017252
so I have the required <form></form> tags that encapsulates my form fields for the search and my datalist control, does this mean that once a user makes all their selections and clicks submit, then it will do the required query.

If so, how do I configure my form to do what's required.
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 17017733
If you're using an ObjectDataSource, you should add your filter parameters as inputs to your SELECT command then do the filtering within the data source.  Of course, you should allow for NULLs where possible (use an unrealistic value for value types like -1 for ints to represent no selection).  Then you can tie the form controls to those input variables and it will all be taken care of behind the scenes.  
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question