System.Data Namespace DataSet Class
Sets or retrieves an XML prefix that aliases the namespace of the DataSet.
Script |
DataSet.Prefix [ = strPrefix ] |
strPrefix |
String specifying the XML prefix for a DataSet namespace. |
The property is read/write with no default value.
The Prefix is used throughout an XML document to identify elements which belong to the DataSet object's namespace ( as set by the Namespace property ).
The following example sets the Prefix before calling the ReadXml method.
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 |
|
C# |
VB |
DataSet Members Namespace