Solved

Searching with codebehind and object datasource

Posted on 2006-06-30
2
328 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

Independent Software Vendors: 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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

628 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