Solved

Searching with codebehind and object datasource

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
About delegates in c sharp 3 50
Greetings C# program 17 107
SQL Login 17 51
Help with C#, MVC, razor. 6 36
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

832 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