DataSet.Prefix 属性  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个 XML 前缀,该前缀是 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, setPublic Property Prefix As String属性值
DataSet 命名空间的 XML 前缀。
- 属性
示例
以下示例在 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
注解
在整个 Prefix XML 文档中使用 属性来标识属于对象命名空间的 DataSet 元素, (属性 Namespace) 设置。