473,668 Members | 2,577 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.Seri alization;

namespace ConsoleApplicat ion1
{
[Serializable()]
public class tResponseGenera lInfo
{
public long ProfileNumber;

public bool ProfileNumberSp ecified;

}

class Class1
{
[STAThread]
static void Main(string[] args)
{
tResponseGenera lInfo obj = new tResponseGenera lInfo();
obj.ProfileNumb er = 23;

XmlDocument oXmlDoc = new XmlDocument();
oXmlDoc.Load(m_ Serialize(obj)) ;
}

private static MemoryStream m_Serialize(obj ect obj)
{
try
{
XmlSerializer serializer = new XmlSerializer(o bj.GetType());
MemoryStream ms = new MemoryStream();
serializer.Seri alize(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 ProfileNumberSp ecified to
something else it works as expected
"<?xml version=\"1.0\" ?><tResponseGen eralInfo
xmlns:xsd=\"htt p://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"htt p://www.w3.org/2001/XMLSchema-instance\"><Pro fileNumberSpeci fied>false</ProfileNumberSp ecified></tResponseGenera lInfo>"

Sep 7 '05 #1
0 873

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

Similar topics

4
1417
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 executed to write client-side vars. Based on these vars, divs are shown or hidden. Why not just write or not write the html stuff server-side? I cannot understand it. And it is UGLY. If other client-events were going to interact with the divs,...
102
5649
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 can't tell where a bracket is missing.... a few weeks have past, I requested a feature for the delphi ide/editor "automatic identation of code in begin/end statements etc" and today when I woke up I suddenly released a very simple solution for this...
17
3012
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). I have a dataset as follows (1 week to keep it short): Employee 1 - Date 1 Employee 1 - Date 2
6
1488
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. Thanks
8
2121
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 7 1 3 1 1 8 8 2 3 1 1 9 9 3 3 1 1 10 10 1 1 2 1
2
7596
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 Web Services section of the Web.config file. at System.Web.Services.Configuration.WebServicesConfiguration.get_Current() at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at...
1
1465
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. for ($i=0; $i < mysql_num_fields($result); $i++) { $st = sprintf("field: %s\n",mysql_field_name($result, $i)); //fputs($stderr, "$st\n"); if (mysql_field_name($result, $i) != "email") { if (mysql_field_name($result, $i) == "first_names") {...
0
1332
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 than to IIS settings which are different in one hosting company to another. I am talking about a site I have that has no pages on it, rather it catches 404 http errors and according to the filename of the missing page, it returns content to...
12
1189
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 way around this. The posts I have read appear to suggest that no-one has yet got a awy to do this. It seems kind of dumb to me. I also find it ironic that the only thing that cant be programmed is the IDE itself! Any suggestions would be...
7
2818
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 seems to work fine, however I noticed that no web log entry is added when a successful download occurs (normally a 200 HTTP status code, however, if there is an authorization failure, it gets logged). I have a logging routine that logs a successful...
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8889
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8570
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5677
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2781
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.