Share via


DumpUtils.DumpDataContainer (IDataContainer, HtmlTextWriter, String) Method (BCL)

Use this method to dump a ContentList or ContentListFactory object to the output stream as HTML with no indentation.

Definition

[Visual Basic .NET]

Public Shared Sub DumpDataContainer( _ByValdc As Microsoft.CommerceServer.Interop.Caching.IDataContainer, _
  ByValoutput As System.Web.UI.HtmlTextWriter, _
  ByValname As System.String _
) 

[C#]

public static void DumpDataContainer(Microsoft.CommerceServer.Interop.Caching.IDataContainerdc,
  System.Web.UI.HtmlTextWriteroutput,
  System.Stringname);

Parameters

[Visual Basic .NET]

  • dc
    The IDataContainer object.
  • output
    The output stream.
  • name
    The name of object for display.

[C#]

  • dc
    The IDataContainer object.
  • output
    The output stream.
  • name
    The name of object for display.

Example

To supply the DumpDataContainer method with an HtmlTextWriter object that wraps the ASP .NET Response object, you must supply an output parameter.

[C#]

// This sample requires a CommerceServer cache of type "Discounts"
// to be configured in the web.config file.
// A reference must be added to the CacheCompLib interop assembly.
using Commerce = Microsoft.CommerceServer.Runtime;
using Microsoft.CommerceServer.Runtime.Diagnostics;
using Microsoft.CommerceServer.Interop.Caching;

Commerce.IDictionary dictCache = (Commerce.IDictionary)CommerceContext.Current.Caches["Discounts"].GetCache();
IDataContainer dataContainer = (IDataContainer)dictCache["Factory"];
DumpUtils.DumpDataContainer(dataContainer, new HtmlTextWriter(Response.Output), "Discounts cache");

[Visual Basic .NET]

' This sample requires a CommerceServer cache of type "Discounts"
' to be configured in the web.config file.
' A reference must be added to the CacheCompLib interop assembly.

Imports Microsoft.CommerceServer.Runtime
Imports Microsoft.CommerceServer.Runtime.Diagnostics
Imports Microsoft.CommerceServer.Interop.Caching

Dim dictCache As Microsoft.CommerceServer.Runtime.IDictionary
dictCache = CType(CommerceContext.Current.Caches("Discounts").GetCache(), Microsoft.CommerceServer.Runtime.IDictionary)
Dim dataContainer As IDataContainer = CType(dictCache.Value("Factory"), IDataContainer)
DumpUtils.DumpDataContainer(dataContainer, New HtmlTextWriter(Response.Output), "Discounts cache")

Requirements

Namespace: Microsoft.CommerceServer.Runtime.Diagnostics

Platforms: Windows 2000, Windows Server 2003

Assembly: Microsoft.CommerceServer.Runtime.dll

Copyright © 2005 Microsoft Corporation.
All rights reserved.