Dijeli putem


DumpDataContainer Method

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

Dumps a ContentList Object or ContentListFactory Object object to the output stream as HTML with no indentation.

This API is not CLS-compliant. 

Namespace:  Microsoft.CommerceServer.Runtime.Diagnostics
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Shared Sub DumpDataContainer ( _
    dc As IDataContainer, _
    output As HtmlTextWriter, _
    name As String _
)
'Usage
Dim dc As IDataContainer
Dim output As HtmlTextWriter
Dim name As String

DumpUtils.DumpDataContainer(dc, output, _
    name)
[CLSCompliantAttribute(false)]
public static void DumpDataContainer(
    IDataContainer dc,
    HtmlTextWriter output,
    string name
)
[CLSCompliantAttribute(false)]
public:
static void DumpDataContainer(
    IDataContainer^ dc, 
    HtmlTextWriter^ output, 
    String^ name
)
public static function DumpDataContainer(
    dc : IDataContainer, 
    output : HtmlTextWriter, 
    name : String
)

Parameters

  • dc
    Type: IDataContainer
    IDataContainer object

Exceptions

Exception Condition
ArgumentNullException

The output or name is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

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

Examples

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")

Permissions

See Also

Reference

DumpUtils Class

DumpUtils Members

Microsoft.CommerceServer.Runtime.Diagnostics Namespace