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

속성 값

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 , , WriteXmlReadXmlSchema또는 WriteXmlSchema 메서드를 사용하여 ReadXmlXML 문서를 읽고 에 DataSet 쓸 때 사용됩니다.

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

적용 대상

추가 정보