Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6727027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:59:56+00:00 2026-05-26T09:59:56+00:00

I have a generated object from running the xsd.exe which has the following property

  • 0

I have a generated object from running the xsd.exe which has the following property with backing field:

private System.DateTime deliveryDateField;

/// <remarks/>
public System.DateTime DeliveryDate 
{
    get 
    {
        return this.deliveryDateField;
    }
    set 
    {
        this.deliveryDateField = value;
    }
}

this is generated from:

<xs:element name="DeliveryDate" type="xs:dateTime" minOccurs="0"/>

which I am trying to serialize using:

var t = new Transaction();
t.DeliveryDate = new DateTime(2011,11,11);
var xs = new XmlSerializer(t.GetType());

string outString;

using (var ms = new MemoryStream())
{
    xs.Serialize(ms, t);
    ms.Position = 0;
    using (var sr = new StreamReader(ms))
    {
       outString = sr.ReadToEnd();
    }
}
return outString;

whatever value I set this to it is getting lost on the serialization process while other elements are fine. What do I need to do to get this serializing properly?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:59:56+00:00Added an answer on May 26, 2026 at 9:59 am

    You probably also have a property called DeliveryDateSpecified on your Transaction class? This is because your DeliveryDate is not mandatory. If you set this to true your DeliveryDate will also get serialized.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a domain object that has been auto generated for me by MyGeneration.
I have some JS code which generates the following object, return { type: some
I have a page in which one chooses from a selection of dynamically generated
I have an XML document that I generate from an Entity Framework object. The
I have an object that is generated in one class public class CreatingClass {
I have an object for which I want to generate a unique hash (override
I have an XSD file which is used to generate some objects which are
I would have expected delegates generated from expression trees to achieve roughly the same
(Note: The project is in Python.) I'm running a simulation in which I have
I have a timer job which has been deployed to a server with multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.