473,508 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this a .Net bug or am i missing something?


Guys please post your comments to ro******@yahoo.com

using System;
using System.Xml;
using System.IO;
using System.Xml.Serialization;

namespace ConsoleApplication1
{
[Serializable()]
public class tResponseGeneralInfo
{
public long ProfileNumber;

public bool ProfileNumberSpecified;

}

class Class1
{
[STAThread]
static void Main(string[] args)
{
tResponseGeneralInfo obj = new tResponseGeneralInfo();
obj.ProfileNumber = 23;

XmlDocument oXmlDoc = new XmlDocument();
oXmlDoc.Load(m_Serialize(obj));
}

private static MemoryStream m_Serialize(object obj)
{
try
{
XmlSerializer serializer = new XmlSerializer(obj.GetType());
MemoryStream ms = new MemoryStream();
serializer.Serialize(ms, obj);
ms.Position = 0;
return ms;
}
catch(Exception ex)
{
throw ex;
}
}
}
}
The xml generates but without the attribute "ProfileNumber", the funny
party is when i change the variable name ProfileNumberSpecified to
something else it works as expected
"<?xml version=\"1.0\"?><tResponseGeneralInfo
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><ProfileNumberSpecified>false</ProfileNumberSpecified></tResponseGeneralInfo>"

Sep 7 '05 #1
0 866

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1409
by: Stephanie Stowe | last post by:
You have a page. On top of the page, there are some search criteria and other input elements and a submit button. The submit button is clicked, sending a request to the server. Server-side code is...
102
5572
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
17
2989
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
6
1471
by: Just Me | last post by:
My Task List contains the following: At least one reference is missing the 'Name' attribute. Any suggestion on how toe find which project is missing it? Solution contains 25 projects. ...
8
2102
by: Elijah Cardon | last post by:
1 1 1 1 1 1 2 2 2 1 1 1 3 3 3 1 1 1 4 4 1 2 1 1 5 5 2 2 1 1 6 6 3 2 1 1 7...
2
7582
by: ken | last post by:
We have a user that has reported the following error when starting up our client application that uses a web service on our back end: System.Configuration.ConfigurationException: Missing required...
1
1460
by: chadw | last post by:
Not sure what I am missing sure its probably something very simple, I need something to get my entered text out of the textbox and entered into a database currently the code looks like this. ...
0
1325
by: amiben | last post by:
Hi everyone. I have this problem that I am experiencing when I move a certain site from one hosting to another hosting location. This is why I think this problem is not related to ASP code, rather...
12
1177
by: The Frog | last post by:
Hi all, Does anyone have a way to print forms at design time directly from the IDE? I am not a great fan of the print screen to paint to print method. I would really like to know if anyone has a...
7
2798
by: =?Utf-8?B?QU9UWCBTYW4gQW50b25pbw==?= | last post by:
Hi, I have been using the code (some of it has been removed for simplicity) below to allow authenticated (using ASP.NET membership database) users to get a file from their archive area. It...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.