DataSet.Prefix Propriété

Définition

Obtient ou définit un préfixe XML qui alias l’espace de noms du DataSet.

public:
 property System::String ^ Prefix { System::String ^ get(); void set(System::String ^ value); };
[System.Data.DataSysDescription("DataSetPrefixDescr")]
public string Prefix { get; set; }
public string Prefix { get; set; }
[<System.Data.DataSysDescription("DataSetPrefixDescr")>]
member this.Prefix : string with get, set
member this.Prefix : string with get, set
Public Property Prefix As String

Valeur de propriété

Préfixe XML de l’espace DataSet de noms.

Attributs

Exemples

L’exemple suivant définit l’exemple Prefix avant d’appeler la ReadXml méthode.

private void ReadData(DataSet thisDataSet)
{
    thisDataSet.Namespace = "CorporationA";
    thisDataSet.Prefix = "DivisionA";

    // Read schema and data.
    string fileName = "CorporationA_Schema.xml";
    thisDataSet.ReadXmlSchema(fileName);
    fileName = "DivisionA_Report.xml";
    thisDataSet.ReadXml(fileName);
}
Private Sub ReadData(thisDataSet As DataSet)
    thisDataSet.Namespace = "CorporationA"
    thisDataSet.Prefix = "DivisionA"

    ' Read schema and data.
    Dim fileName As String = "CorporationA_Schema.xml"
    thisDataSet.ReadXmlSchema(fileName)
    fileName = "DivisionA_Report.xml"
    thisDataSet.ReadXml(fileName)
End Sub

Remarques

La Prefix propriété est utilisée dans un document XML pour identifier les éléments qui appartiennent à l’espace de noms de l’objet DataSet (comme défini par la Namespace propriété).

S’applique à

Voir aussi