Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 18th, 2006, 11:46 AM
Registered User
Join Date: Sep 2005
Location: Leicester, , United Kingdom.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default ObjectDataSource and Wildcards


How can I pass a wildcard to a stored procedure (via BLL and then DAL) with objectdatasource?

I have two parameters in the sproc, one is integer, the other boolean.

The sproc is of the form SELECT * FROM TableName WHERE Param1 = @Param1 and Param2 = @Param2.

On initial load, I want my GridView to show all values (i.e. substituting sproc params for *), and then allow the user to filter the data using control parameters and dropdownlists.


PS I've tried using the ObjectDataSource's post-bind filtering, and it doesn't work properly

  #2 (permalink)  
Old October 19th, 2006, 09:08 PM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts

Try altering the SP to show both

If @PAram is Null
   SELECT * FROM TableName
   SELECT * FROM TableName WHERE Param1 = @Param1 and Param2 = @Param2

This should Work



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable the wildcards(% and _) kasipandian Oracle 1 February 4th, 2008 12:32 AM
XSLT Wildcards? kwilliams XSLT 2 September 28th, 2005 10:54 AM
Datetime, wildcards etc SoC Classic ASP Basics 6 July 19th, 2005 08:53 PM
Using wildcards in subquery hman SQL Language 2 April 11th, 2005 06:18 AM
Help using wildcards in query hman SQL Language 2 April 6th, 2005 03:40 AM

All times are GMT -4. The time now is 11:01 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.