Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with mmPicker and DataCommandType.StoredProcedur
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
00999745
Message ID:
01000941
Views:
50
Chris,

>If I use a stored procedure and set the DataCommandType to StoredProcedure, mmPicker works fine but it won't filter the results. For example, if I type in an 'I' and hit enter, the list is not filtered to show just the companies that start with I. It works fine if I use DataCommandType = Text.

The reason it's working differently for a stored procedure is because it doesn't know the nature of your stored procedure and how to filter data. With a SQL SELECT statement, an additional WHERE clause is simply added to the end of the statement. With a stored procedure, you need to set the Picker's DataCommandFilterParameterName property to the name of a parameter in your stored procedure into which a filter string can be placed. For example, you may add a "@FilterParameter" parameter to your stored procedure, and then set the Picker's DataCommandFilterParameterName property to "@FilterParameter". At run time, the picker logic sets the value of @FilterParameter to a corresponding WHERE clause (such as "CustomerName LIKE 'OAK'") and this parameter is passed to your stored procedure. Within your stored procedure you can use this filter to filter the items in the picklist.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform