Condividi tramite


SqlCeCommand.IndexName Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Specifies the index to be opened.

  [Visual Basic]
  Public Property IndexName As String
[C#]
public string IndexName {get; set;}
[C++]
public: __property String* get_IndexName();
public: __property void set_IndexName(String*);
[JScript]
public function get IndexName() : String;
public function set IndexName(String);

Property Value

The name of the index to be opened.

Remarks

IndexName allows the SqlCeDataReader to retrieve rows from a base table based on the order of the rows in the specified index. This allows for ordered retrieval of rows without using a SELECt statement. For example, to retrieve employees based on employee ID, the client could execute SELECT * FROM Employees ORDER BY

EmployeeID, but results can be returned more quickly by reading from an index using the IndexName property. This property can only be used on a command with CommandType set to BaseTable and CommandText set to a valid base table that contains the specified index.

Retrieving rows from an index using the IndexName property will retrieve all rows from a base table in index order. To restrict the rows returned, use SetRange; to look for a specific value in the index, use Seek.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeCommand Class | SqlCeCommand Members | System.Data.SqlServerCe Namespace

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.