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



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

Parameters

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

Return Value

Returns a XmlSchemaComplexType that describes a TdPeriodTimestampWithTimeZone.
Example
This examples shows how to use TdPeriodTimestampWithTimeZone with the Xml.Serialization.XmlSerializer class. Xml.Serialization.XmlElementAttribute is used to indicate that the column can be Null.
public class ProductAdvertisement
 {
     public TdDate Date;
            
     public Int32 ProductId;
            
     public Int32? QuantityAvailable;
             
     public TdPeriodTimestampWithTimeZone advertisePeriod
            
     public String adPlacement;
 }
             
 internal class ProductAdvertisementWriter
 {
 
     public static void Write()
     {
         // Setup the advertisement
         ProductAdvertisement x = new ProductAdvertisement();
 
         x.Date = new TdDate(DateTime.Today);
         x.ProductId = 100;
         x.QuantityAvailable = 2000;
             
         // Advertisement will last for 14 days, 23 hours, 59 minutes, 59 seconds from today
         x.AdvertisePeriod = 
                new TdPeriodTimestampWithTimeZone(
                    new TdTimestampWithTimeZone(DateTime.Today, new TimeSpan(8, 0, 0)), 
                    new TdTimestampWithTimeZone((DateTime.Today + new TimeSpan(14, 23, 59, 59)), new TimeSpan(8, 0, 0));
         x.adPlacement = "The Newspaper";
            
         // Write out today's orders to the file.
         //
         // Open the file.
         XmlWriterSettings settings = new XmlWriterSettings();
         settings.Indent = true;
         XmlWriter writer = XmlWriter.Create(@"C:\Temp\ProductAdvertisements.XML", settings);
         writer.WriteStartElement("ProductAdvertisements");
   
         // Write out the schema.
         XmlSchemas schemas = new XmlSchemas();
         XmlSchemaExporter schExporter = new XmlSchemaExporter(schemas);
         schExporter.ExportTypeMapping(new XmlReflectionImporter().ImportTypeMapping(typeof(ProductAdvertisement)));
         schemas[0].Write(writer);
            
         // Write out the orders.
         XmlSerializer xml = new XmlSerializer(typeof(ProductAdvertisement));
         xml.Serialize(writer, x);
 
         // Close the document.
         writer.WriteEndDocument();
         writer.Close();
     }
 }
             
/* Output is:
             
2007-02-0110020002007-02-01 12:00:00+08:002007-02-08 08:00:00+08:00The Newspaper
             
*/
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdPeriodTimestampWithTimeZone Structure
TdPeriodTimestampWithTimeZone Members