Share via


DBStorage.GetData Method (PIA)

Use this method to retrieve a row of data from the database, based on the specified key value. If the data is found, this method creates and returns an OrderForm or Dictionary object containing the requested data.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Orders
…
Public Function GetData(vtReserved As Object,
 vtKey As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop.Orders;
…
public object GetData(objectvtReserved,
 objectvtKey);

Parameters

[Visual Basic .NET]

  • vtReserved
    An Object reserved for future use. The GetData method ignores any value stored in this parameter.
  • vtKey
    An Object that contains the key value on which to base the search. The GetData method searches for this value in the table column specified as the table key in the initial call to the InitStorage method.

[C#]

  • vtReserved
    A object reserved for future use. The GetData method ignores any value stored in this parameter.
  • vtKey
    A object that contains the key value on which to base the search. The GetData method searches for this value in the table column specified as the table key in the initial call to the InitStorage method.

Return Values

[Visual Basic .NET] If this method completes successfully, an Object containing a Dictionary or OrderForm object that contains the retrieved row is returned.

[C#] This method returns an object containing a Dictionary or OrderForm object used to return the retrieved row.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Remarks

For performance reasons, the GetData method is preferred over the LookupData method when the column being searched is the key.

[Visual Basic .NET]

Example

' Order is a Commerce.OrderForm object; OrderFormStorage is 
' an initialized Commerce.DBStorage object; oVar is an Object
Order.order_id = "Order_tmp"
oVar = OrderFormStorage.GetData(DBNull.Value, Order.order_id)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Orders

Platforms: Windows 2000, Windows Server 2003

Assembly: commercelib (in commercelib.dll)

See Also

DBStorage Class

DBStorage.InitStorage

DBStorage.LookupData

Copyright © 2005 Microsoft Corporation.
All rights reserved.