Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 18th, 2006, 11:46 AM
Registered User
Join Date: Sep 2005
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

Old October 19th, 2006, 09:08 PM
Friend of Wrox
Join Date: Sep 2005
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



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

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