DataSet.Namespace 속성

정의

DataSet의 네임스페이스를 가져오거나 설정합니다.

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

속성 값

String

DataSet의 네임스페이스입니다.

특성

예외

네임스페이스에 데이터가 이미 있는 경우

예제

다음 예제에서는 메서드를 Prefix 호출 ReadXml 하기 전에 설정합니다.

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

설명

Namespace 속성은 XML 문서를 DataSet 읽고 메서드를 사용하여 ReadXmlSchemaReadXmlWriteXmlWriteXmlSchema 작성할 때 사용됩니다.

XML 문서의 네임스페이스는 읽어들일 때 XML 특성 및 요소의 범위를 지정하는 DataSet데 사용됩니다. 예를 들어 DataSet 네임스페이스가 "myCompany"인 문서에서 읽은 스키마가 포함되어 있고 다른 네임스페이스가 있는 문서에서만 데이터를 읽으려는 경우 기존 스키마에 해당하지 않는 모든 데이터는 무시됩니다.

적용 대상

추가 정보