Parameter for all values

J

Jim McGivney

This is probably a Newbie question, but your response would be appreciated.

Using VWD I have a GridView on a page. The GridView is feed data by
accessdatasource1.



I can filter the data using:



Parameter Param = new Parameter("Sex");

Param.DefaultValue = Sex;

AccessDataSource1.FilterParameters.Add(Param);



AccessDataSource1.FilterExpression = "Sex LIKE '{0}'";



AccessDataSource1.SelectCommand = "SELECT DataNum, CaseNum,
Disp, Type, Last, First, MI, SSN, Sex, Race, DOB, ID, AdditionalInfo,
FileName FROM DataAA";



AccessDataSource1.DataFile =
System.Configuration.ConfigurationManager.AppSettings["ConnString"];



This works.



At times I want the filter to pass all Sex values (Male, Female, Unknown).
What do I use for the default value when I want all entries passed ?



Do I use:

Parameter Param = new Parameter("Sex");

Param.DefaultValue = "*";

AccessDataSource1.FilterParameters.Add(Param);



Or

Param.DefaultValue = "All";



Or do I use something else.
Sample code appreciated.



Thanks in advance for your help.



Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,132
Latest member
TeresaWcq1
Top