DataSet.Prefix Właściwość

Definicja

Pobiera lub ustawia prefiks XML, który aliasuje przestrzeń nazw .DataSet

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

Wartość właściwości

String

Prefiks XML dla DataSet przestrzeni nazw.

Atrybuty

Przykłady

Poniższy przykład ustawia metodę Prefix ReadXml przed wywołaniem metody .

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

Uwagi

Właściwość Prefix jest używana w całym dokumencie XML do identyfikowania elementów należących do przestrzeni nazw DataSet obiektu (zgodnie z właściwością Namespace ).

Dotyczy

Zobacz też