DB2®DataReader.GetXmlSchemaCollection(IBM®.Data.DB2Types.DB2XsrObjectId) Method
Returns an XmlSchemaCollection object of all the schema documents for the given DB2XsrObjectId.
- Namespace:
IBM.Data.DB2
- Assembly:
IBM.Data.DB2
(inIBM.Data.DB2.dll
)
Syntax
[Visual Basic]
Public Function GetXmlSchemaCollection( _
ByVal xsrObjectId As DB2XsrObjectId _
) As XmlSchemaCollection
[C#]
public XmlSchemaCollection GetXmlSchemaCollection(
DB2XsrObjectId xsrObjectId
);
[C++]
public: XmlSchemaCollection* GetXmlSchemaCollection(
DB2XsrObjectId xsrObjectId
);
[JScript]
public function GetXmlSchemaCollection(
xsrObjectId : DB2XsrObjectId
) : XmlSchemaCollection;
Parameters
- xsrObjectId
- The DB2XsrObjectId to search on.
Return value
An XmlSchemaCollection object of all the schema documents used to validate the given column.
Remarks
Applications using .NET Framework 1.1 should use the GetXmlSchemaCollection method instead.
Example
[C#] The following example demonstrates how to use the GetXmlSchemaCollection method. XmlReader.
[C#]
public static string getProdData(DB2Connection conn)
{
String xmlString = "";
DB2XsrObjectId xmlSchemaId;
String cmdSQL = "SELECT description, XMLXSROBJECTID(description) FROM product";
DB2Command cmd = new DB2Command(cmdSQL, conn);
DB2DataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
DB2Xml description = reader.GetDB2Xml(0);
xmlSchemaId = reader.GetDB2XsrObjectId(1);
if (!xmlSchemaId.IsNull)
{
XmlSchemaCollection sc = reader.GetXmlSchemaCollection(xmlSchemaId);
}
xmlString += description.GetString();
}
reader.Close();
return xmlString;
}