Share via


PropertiesToReturn Property

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Gets or sets a comma separated list of properties that a method returns in a query result set.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Property PropertiesToReturn As String
'Usage
Dim instance As CommonSearchOptions
Dim value As String

value = instance.PropertiesToReturn

instance.PropertiesToReturn = value
public string PropertiesToReturn { get; set; }
public:
property String^ PropertiesToReturn {
    String^ get ();
    void set (String^ value);
}
public function get PropertiesToReturn () : String
public function set PropertiesToReturn (value : String)

Property Value

Type: System..::.String
A String object containing a comma-delimited list of property names.

Remarks

A coma-delimited list of the properties that is to be returned by the search. An empty collection indicates that the method returns all properties.

The PropertiesToReturn is to ensure consistency with all other subsystems and for backward compatibility. The differences between this property and PropertiesToReturnArray are this property gets and sets a comma-delimited list of the same array as PropertiesToReturnArray.

Examples

Use the following code to return a column named UnitPrice that can be bound to a control. The UnitPrice column contains the price per unit of the product, calculated by dividing the cy_list_price by the number of units. If Units is set to zero, the UnitPrice is the same as the cy_list_price. This sample assumes that you have a user-defined property named Units that stores the number of units that are sold for the given cy_list_price price.

CatalogSearchOptions searchOptions = new CatalogSearchOptions();
searchOptions.PropertiesToReturn = "(cy_list_price/isnull(nullif(Units,0),1))UnitPrice, PID"; 
DataSet ds = cat.GetProducts(searchOptions); 

Permissions

See Also

Reference

CommonSearchOptions Class

CommonSearchOptions Members

Microsoft.CommerceServer.Catalog Namespace

PropertiesToReturnArray