Send feedback on this topic.
Teradata.Client.Provider
GetXmlSchema Method (TdTimeWithTimeZone)
Example 



Teradata.Client.Provider Namespace > TdTimeWithTimeZone Structure : GetXmlSchema Method
Holds zero or more XML Schema definition language (XSD) schemas.
Specifies the XML Qualified name for TdTimeWithTimeZone XML type mapping.
Syntax
'Declaration
 
Public Shared Function GetXmlSchema( _
   ByVal xmlSchemaSet As XmlSchemaSet _
) As XmlQualifiedName
'Usage
 
Dim xmlSchemaSet As XmlSchemaSet
Dim value As XmlQualifiedName
 
value = TdTimeWithTimeZone.GetXmlSchema(xmlSchemaSet)
public static XmlQualifiedName GetXmlSchema( 
   XmlSchemaSet xmlSchemaSet
)
public:
static XmlQualifiedName^ GetXmlSchema( 
   XmlSchemaSet^ xmlSchemaSet
) 

Parameters

xmlSchemaSet
Holds zero or more XML Schema definition language (XSD) schemas.

Return Value

Returns xs:dateTime.
Example
This examples shows how to use TdTimeWithTimeZone with Xml.Serialization.XmlSerializer class. Xml.Serialization.XmlElementAttribute is used to indicate that the column can be Null.
public class Order
{
    public TdTimeWithTimeZone AtTime;
            
    public Int32 ProductId;
            
    public Int32 Quantity;
            
    public Int32? BackOrderQuantity;
            
    [XmlElementAttribute(IsNullable = true)]        
    public TdDecimal BackOrderPrice;
}
             
internal class OrderWriter
{
              
    public static void Write()
    {
        // Setup the order
        Order x = new Order();
              
        x.AtTime = new TdTimeWithTimeZone(new TimeSpan(20, 12, 34), new TimeSpan(-08, 0, 0));
        x.ProductId = 100;
        x.Quantity = 2000;
        x.BackOrderQuantity = null;
        x.BackOrderPrice = TdDecimal.Null;
            
        // Write out today's orders to the file.
        //
        // Open the file.
        XmlWriterSettings settings = new XmlWriterSettings();
        settings.Indent = true;
        XmlWriter writer = XmlWriter.Create(@"C:\Temp\TodayOrders.XML", settings);
        writer.WriteStartElement("TodayOrders");
  
        // Write out the schema.
        XmlSchemas schemas = new XmlSchemas();
        XmlSchemaExporter schExporter = new XmlSchemaExporter(schemas);
        schExporter.ExportTypeMapping(new XmlReflectionImporter().ImportTypeMapping(typeof(Order)));
        schemas[0].Write(writer);
            
        // Write out the orders.
        XmlSerializer xml = new XmlSerializer(typeof(Order));
        xml.Serialize(writer, x);
              
        // Close the document.
        writer.WriteEndDocument();
        writer.Close();
    }
}
             
/* Output is:
             
 <TodayOrders>
  <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Order" nillable="true" type="Order" />
    <xs:complexType name="Order">
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" name="AtTime" type="xs:time" />
        <xs:element minOccurs="1" maxOccurs="1" name="ProductId" type="xs:int" />
        <xs:element minOccurs="1" maxOccurs="1" name="Quantity" type="xs:int" />
        <xs:element minOccurs="1" maxOccurs="1" name="BackOrderQuantity" nillable="true" type="xs:int" />
        <xs:element minOccurs="1" maxOccurs="1" name="BackOrderPrice" nillable="true" type="xs:decimal" />
      </xs:sequence>
    </xs:complexType>
  </xs:schema>
  <Order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <AtTime>20:12:34-08:00</AtTime>
    <ProductId>100</ProductId>
    <Quantity>2000</Quantity>
    <BackOrderQuantity xsi:nil="true" />
    <BackOrderPrice xsi:nil="true" />
  </Order>
</TodayOrders>
             
*/
Requirements
ProductVersionsPlatforms
.NET2.1, 3.1, 6Windows, Linux, MacOS
.NET Framework4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdTimeWithTimeZone Structure
TdTimeWithTimeZone Members