Solved

Searching with codebehind and object datasource

Posted on 2006-06-30
2
324 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
2 Comments
 
LVL 4

Author Comment

by:claracruz
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now