Export (0) Print
Expand All

DataSet.ExtendedProperties Property

Gets the collection of customized user information associated with the DataSet.

Namespace: System.Data
Assembly: System.Data (in system.data.dll)

public PropertyCollection ExtendedProperties { get; 
/** @property */
public PropertyCollection get_ExtendedProperties ()

public function get ExtendedProperties () : PropertyCollection

Property Value

A PropertyCollection with all custom user information.

The ExtendedProperties property enables you to store custom information with the DataSet. For example, you might store a time when the data should be refreshed.

Extended properties must be of type String if you want them persisted when the DataSet is written as XML.

The following example adds a custom property to the PropertyCollection returned by the ExtendedProperties property. The second example retrieves the custom property.

private void DemonstrateEnforceConstraints()
{
    // Create a DataSet with one table, one column and 
    // a UniqueConstraint.
    DataSet dataSet= new DataSet("dataSet");
    DataTable table = new DataTable("table");
    DataColumn column = new DataColumn("col1");

    // A UniqueConstraint is added when the Unique 
    // property is true.
    column.Unique=true;
    table.Columns.Add(column);
    dataSet.Tables.Add(table);
    Console.WriteLine("constraints.count: " + 
        table.Constraints.Count);

    // add five rows.
    DataRow row ;
    for(int i=0;i<5;i++)
    {
        row = table.NewRow();
        row["col1"] = i;
        table.Rows.Add(row);
    
    table.AcceptChanges();

    dataSet.EnforceConstraints=false;
    // Change the values of all rows to 1.
    foreach(DataRow thisRow in table.Rows)
    {
        thisRow["col1"]=1;
        //Console.WriteLine("\table" + thisRow[0]);
    
    try
    {
        dataSet.EnforceConstraints=true;
    
    catch(System.Data.ConstraintException e)
    {
        // Process exception and return.
        Console.WriteLine("Exception of type {0 occurred.", 
            e.GetType());
    


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft