Serializing value types

When a class contains a TimeSpan property, XmlSerializer doesn't work.  A 
TimeSpan property is serialized like:

<MySpan />

I've read a number of posts that talk about why this happens and how to work 
around it.  My question is from a slightly different angle.  What can I do 
to my value type structures so that XmlSerializer can serialize them 
properly?

For example, I have a TimeOfDay structure, what can I do to my TimeOfDay 
structure so that XmlSerializer works?  I've already discovered that I can 
add a public property to TimeOfDay like this:

[XmlAttribute]
public string value
{
    get { ...return the time of day as a string...}
    set { ...set the time of day from a string...}
}

so, if another object has a TimeOfDay property named StartTime, it is 
serialized like:

<StartTime value="14:30" />

which isn't too bad but, it breaks if the consumer puts [XmlAttribute] on 
their property.  And, I have this strange "value" property hanging around 
that I have to tell people to ignore.

Any suggestions?

Thanks,

John Vottero



0
John412 (3)
10/15/2004 6:07:49 PM
dotnet.xml 7266 articles. 0 followers. Follow

4 Replies
526 Views

Similar Articles

[PageSpeed] 36

Hi John,

First of all, I would like to confirm my understanding of your issue. From 
your description, I'm still not quite sure what you get. Do you mean that 
adding a [XmlAttribute] on a property that returns TimeOfDay type will make 
the serialized data look bad?

Could you please paste some repro code here and show us the desired result? 
Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no 
rights."

0
v-kevy (347)
10/16/2004 7:24:08 AM
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message 
news:6O1EdE1sEHA.1768@cpmsftngxa06.phx.gbl...
> Hi John,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I'm still not quite sure what you get. Do you mean that
> adding a [XmlAttribute] on a property that returns TimeOfDay type will 
> make
> the serialized data look bad?

Not exactly.  The issue is, XmlSerializer can't serialize value types.  If 
someone uses my TimeOfDay type like this:

public TimeOfDay StartTime
{
    get { return m_StartTime;}
    set { m_StartTIme = value; }
}

When the containing class is serialized by XmlSerializer they get:

<StartTime />

Note that there's no data.  What I want, is something like:

<StartTime>08:00</StartTime>

If the consumer class adds [XmlAttribute] to the StartTime property, they 
get this error:

There was an error reflecting property 'StartTime'.
Cannot serialize member 'StartTime'. XmlAttribute/XmlText cannot be used to 
encode complex types.

when they try to serialize with XmlSerializer.

What I want is something like:

<ConsumerClass StartTime="08:00">


What can I do to my TimeOfDay type to make it work with XmlSerializer?


>
> Could you please paste some repro code here and show us the desired 
> result?
> Thanks!

I will work up a short but complete example.


0
John412 (3)
10/16/2004 6:26:05 PM
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message 
news:6O1EdE1sEHA.1768@cpmsftngxa06.phx.gbl...
> Hi John,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I'm still not quite sure what you get. Do you mean that
> adding a [XmlAttribute] on a property that returns TimeOfDay type will 
> make
> the serialized data look bad?
>
> Could you please paste some repro code here and show us the desired 
> result?
> Thanks!
>

Here's a short console program that reproduces the problem followed by the 
code for the TimeOfDay type.


using System;
using System.Xml.Serialization;

namespace XmlSample
{
    /// <summary>
    /// The Consumer class is just a simple example of a class that consumes
    /// the TimeOfDay object.  This is used to illustrate a problem with 
XmlSerializer,
    /// the StartTime property isn't serialized correctly.  The real 
question is:
    ///
    /// What can be done to the TimeOfDay type to make XmlSerializer work?
    ///
    /// </summary>
    public class Consumer
    {
        public Consumer()
        {
        }

        public string Name
        {
            get
            {
                return m_Name;
            }
            set
            {
                m_Name = value;
            }
        }

        public TimeOfDay StartTime
        {
            get
            {
                return m_StartTime;
            }
            set
            {
                m_StartTime = value;
            }
        }

        //
        //  Private property backers
        //
        private string m_Name;
        private TimeOfDay m_StartTime;
    }

    /// <summary>
    /// Class1 contains the Main method.
    /// </summary>
    class Class1
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            //
            //  Create and populate a Consumer object
            //
            Consumer co = new Consumer();

            co.Name = "John";
            co.StartTime = new TimeOfDay("10:30");

            //
            //  Create the XmlSerializer
            //
            XmlSerializer serializer = new XmlSerializer(co.GetType());

            //
            //  Serialize!!
            //
            serializer.Serialize(Console.Out, co);

            //
            //  Pause
            //
            Console.WriteLine();
            Console.WriteLine("StartTime should be {0}", co.StartTime);
            Console.WriteLine("Press Return to continue");
            Console.ReadLine();
        }
    }
}





///////  TimeOfDay.cs

using System;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Xml.Serialization;

namespace XmlSample
{
    /// <summary>
    /// TimeOfDayConverter is a TypeConverter for the TimeOfDay type.
    /// </summary>
    public class TimeOfDayConverter : TypeConverter
    {
        /// <summary>
        /// Returns true if the passed source Type can be converted into a 
TimeOfDay.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="sourceType">THe Type to be converted.</param>
        /// <returns>True if the conversion can be done.</returns>
        public override bool CanConvertFrom(
            ITypeDescriptorContext context, Type sourceType)
        {
            if (sourceType == typeof(string))
            {
                return true;
            }
            else
            {
                return base.CanConvertFrom(context, sourceType);
            }
        }

        /// <summary>
        /// Converts the passed value into a TimeOfDay.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="culture"></param>
        /// <param name="value">The value to convert into a 
TimeOfDay.</param>
        /// <returns>The new TimeOfDay.</returns>
        public override object ConvertFrom(
            ITypeDescriptorContext context, CultureInfo culture, object 
value)
        {
            if (value is string)
            {
                return TimeOfDay.Parse((string)value);
            }
            else
            {
                return base.ConvertFrom(context, culture, value);
            }
        }

        /// <summary>
        /// Converts the passed TimeOfDay into the passed destination Type.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="culture"></param>
        /// <param name="value">The TimeOfDay</param>
        /// <param name="destinationType">The destination Type</param>
        /// <returns>The new object created from the TimeOfDay.</returns>
        public override object ConvertTo(
            ITypeDescriptorContext context, CultureInfo culture, object 
value, Type destinationType)
        {
            if ((destinationType == typeof(string))
                && (value is TimeOfDay))
            {
                return 
((TimeOfDay)value).ToString(culture.DateTimeFormat.ShortTimePattern);
            }
            else
            {
                return base.ConvertTo(context, culture, value, 
destinationType);
            }
        }
    }

    /// <summary>
    /// The TimeOfDay represents a time of day.
    /// </summary>
    [Serializable,
    TypeConverter(typeof(TimeOfDayConverter)),
    XmlType("time")]
    public struct TimeOfDay : IComparable, IFormattable, ISerializable
    {
        private int timeOfDay;  // The number of seconds since midnight (-1 
means NULL)

        /// <summary>
        /// Constructs a TimeOfDay from an integer which is the seconds 
since midnight.
        /// </summary>
        /// <param name="initial">The seconds since midnight.</param>
        public TimeOfDay(int initial)
        {
            timeOfDay = initial;
        }

        /// <summary>
        /// Constructs a TimeOfDay from a DateTime.
        /// </summary>
        /// <param name="initial">The DateTime to create the TimeOfDay 
from.</param>
        public TimeOfDay(DateTime initial)
        {
            timeOfDay = (int)(initial.TimeOfDay.Ticks / 
TimeSpan.TicksPerSecond);
        }

        /// <summary>
        /// Constructs a TimeOfDay from a string.
        /// </summary>
        /// <param name="initial">The string.</param>
        public TimeOfDay(string initial)
        {
            DateTime tmpDT;

            try
            {
                tmpDT = DateTime.Parse(initial);
                timeOfDay = (int)(tmpDT.TimeOfDay.Ticks / 
TimeSpan.TicksPerSecond);
            }
            catch
            {
                timeOfDay = -1;
            }
        }

        /// <summary>
        /// A TimeOfDay that is the current time.
        /// </summary>
        public static TimeOfDay Now
        {
            get
            {
                return new TimeOfDay(DateTime.Now);
            }
        }

//        [XmlAttribute]
//        public string value
//        {
//            get
//            {
//                if (timeOfDay < 0)
//                {
//                    return null;
//                }
//                else
//                {
//                    return "10:30";
//                }
//            }
//            set
//            {
//                timeOfDay = -1;
//            }
//        }

        /// <summary>
        /// A TimeOfDay that represents a time that is not specified.
        /// </summary>
        public static TimeOfDay Empty
        {
            get
            {
                return new TimeOfDay(-1);
            }
        }

        /// <summary>
        /// Parse a formatted string and return it as a TimeOfDay
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static TimeOfDay Parse(string input)
        {
            DateTime tmpDT;
            int ticks;

            try
            {
                tmpDT = DateTime.Parse(input);
                ticks = (int)(tmpDT.TimeOfDay.Ticks / 
TimeSpan.TicksPerSecond);
            }
            catch
            {
                ticks = -1;
            }

            return new TimeOfDay(ticks);
        }

        /// <summary>
        /// Compare two TimeOfDay objects.
        /// </summary>
        /// <param name="obj">The TimeOfDay to compare to.</param>
        /// <returns>-1, 0 or 1.</returns>
        public int CompareTo(object obj)
        {
            if (obj is TimeOfDay)
            {
                //
                //  We can do this
                //
                TimeOfDay otherTime = (TimeOfDay) obj;
                return timeOfDay - otherTime.timeOfDay;
            }
            else
            {
                throw new ArgumentException();
            }
        }

        /// <summary>
        /// Compares two TimeOfDay objects to see if they represent the same 
time.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            return (this.timeOfDay == ((TimeOfDay)obj).timeOfDay);
        }

        /// <summary>
        /// Returns a hashcode for this time.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            return base.GetHashCode ();
        }


        /// <summary>
        /// Compare two times to see if the left is less than the right.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public static bool operator <(TimeOfDay left, TimeOfDay right)
        {
            return (left.CompareTo(right) < 0);
        }

        /// <summary>
        /// Compare two times to see if the left is less than or equal to 
the right.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public static bool operator <=(TimeOfDay left, TimeOfDay right)
        {
            return (left.CompareTo(right) <= 0);
        }

        /// <summary>
        /// Compare two times to see if the left is greater than the right.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public static bool operator >(TimeOfDay left, TimeOfDay right)
        {
            return (left.CompareTo(right) > 0);
        }

        /// <summary>
        /// Compare two times to see if the left is greater than or equal to 
the right.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public static bool operator >=(TimeOfDay left, TimeOfDay right)
        {
            return (left.CompareTo(right) >= 0);
        }

        /// <summary>
        /// Compare two times to see if they are equal.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public static bool operator ==(TimeOfDay left, TimeOfDay right)
        {
            return (left.CompareTo(right) == 0);
        }

        /// <summary>
        /// Compare two times to see if they are not equal.
        /// </summary>
        /// <param name="left"></param>
        /// <param name="right"></param>
        /// <returns></returns>
        public static bool operator !=(TimeOfDay left, TimeOfDay right)
        {
            return (left.CompareTo(right) != 0);
        }



        /// <summary>
        /// Converts a TimeOfDay to a string.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return ToString(
                CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern,
                null);
        }

        /// <summary>
        /// COnverts a TimeOfDay to a string using the specified 
formatProvider.
        /// </summary>
        /// <param name="formatProvider"></param>
        /// <returns></returns>
        public string ToString(IFormatProvider formatProvider)
        {
            return ToString(
                CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern,
                formatProvider);
        }

        /// <summary>
        /// COnverts a TimeOfDay to a string using the specified format.
        /// </summary>
        /// <param name="format"></param>
        /// <returns></returns>
        public string ToString(string format)
        {
            return ToString(format, null);
        }

        /// <summary>
        /// Converts a TimeOfDay to a string using the specified format and 
format provider.
        /// </summary>
        /// <param name="format"></param>
        /// <param name="formatProvider"></param>
        /// <returns></returns>
        public string ToString(string format, IFormatProvider 
formatProvider)
        {
            if ((timeOfDay < 0) || (timeOfDay >= 86400))
            {
                //
                //  The value is out of range
                //  We interpret this as a null time
                //
                return string.Empty;
            }
            else
            {
                //
                //  We have a valid value (number of seconds since midnight)
                //
                DateTime dtTmp = DateTime.Today;
                dtTmp = dtTmp.AddSeconds(timeOfDay);
                if (format == null)
                {
                    return dtTmp.ToString(
                        CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern,
                        formatProvider);
                }
                else
                {
                    return dtTmp.ToString(format, formatProvider);
                }
            }
        }

        /// <summary>
        /// Returns a TimeSpan from midnight to the TimeOfDay
        /// </summary>
        /// <returns></returns>
        public TimeSpan ToTimeSpan()
        {
            if (timeOfDay >= 0)
            {
                return new TimeSpan((TimeSpan.TicksPerSecond * timeOfDay));
            }
            else
            {
                return new TimeSpan(0);
            }
        }

        /// <summary>
        /// Returns the seconds between midnight and the time of day.
        /// </summary>
        public int TotalSeconds
        {
            get
            {
                return timeOfDay;
            }
        }
        #region Implementation of ISerializable
        //
        //  Code generated by BuildISerializable
        //

        /// <summary>
        /// Deserialization constructor.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        private TimeOfDay(SerializationInfo info, StreamingContext context)
        {
            timeOfDay = info.GetInt32("timeOfDay");
        }

        /// <summary>
        /// Serializes a TimeOfDay.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        // An unknown external module throws a SEHException when this line 
is uncommented
        //[SecurityPermission(SecurityAction.Demand, 
SerializationFormatter=true)]
        public void GetObjectData(SerializationInfo info, StreamingContext 
context)
        {
            info.AddValue("timeOfDay", timeOfDay);
        }
        #endregion
    }
}


0
John412 (3)
10/19/2004 1:20:26 AM
Hi John,

Since Xml Serialization only serializes public fields, I added a public 
property to the Comsumer class.

		public string val
		{
			get
			{
				return m_StartTime.ToString();
			}
			set
			{
				m_StartTime = TimeOfDay.Parse(value);
			}
		}

As far as I can see, I don't know any better way to serialize the TimeOfDay 
struct. Sorry for the inconvenience. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no 
rights."

0
v-kevy (347)
10/19/2004 12:34:52 PM
Reply:

Similar Artilces:

#Value #6
I am calculating percentages and in one cell the formula works and in the next it gives me a #value error, the formulas match perfectly just different cells. Can anyone explain this. This is the formula =IF(E11:E14="",0,SUMIF(E11:E14,">0")/COUNTIF(E11:E14,">0")) You sure you don't want a formula like: =IF(COUNT(E11:E14)=0,0,SUMIF(E11:E14,">0")/COUNTIF(E11:E14,">0")) or even: =IF(COUNTIF(E11:E14,">0")=0,0,SUMIF(E11:E14,">0")/COUNTIF(E11:E14,">0")) Todd Nelson wrote: > > I am ...

Bulk upload of pick list values
Hi, I have created some new fields in CRM which are picklist type. Is there any way to bulk upload picklist values into that field so I would not have to type them manually? The problem is I have some picklist fields which should comprise more than 100 picklist values and to think of typing them manually .... Thanks. Unfortunately you do have to type all the values in the picklist manually... "Mikkhail" <Mikkhail@discussions.microsoft.com> wrote in message news:86D6D7CF-25E4-4658-8FAD-FF9DE934AD5A@microsoft.com... > Hi, > > I have created some new fields in C...

Account for null values on a report
Hi - i have several reports that i am creating for users to input their required criteria - i.e. a report using query by form - they all work fine unless the criteria a user enters results in an empty query. the fields on the form are all summed or counted e.g. =Count([loanID]) to count the number of loans made, =Sum([amountloaned]) to show the total amount of money loaned. I am trying to account for the null values otherwise the fields on the report just show 'error'. I a trying to use the Nz function but am unsure if it will work on a field already using another function =...

Transpose stacked lists of values
I have a column with repeating labels, and a second column with values. Example: Column A Column B Label1 Value1 Label2 Value2 Label3 Value3 Label1 Value4 Label2 Value5 Label3 Value6 Label1 Value7 Label2 Value8 Label3 Value9 I need to transpose these so that the Labels in column A become column headers, and the corresponding values for each label appear in the rows below each column header. Example: Label1 Label2 Label3 Value1 Value2 Value3 Value4 Value5 Valu...

How do I create a chart out of a list, instead of number values?
I'm trying to create a Pie Chart from a list of Questionnaire results. Each questionnaire's results will be recorded in a row. For example, one of the questions is "Gender?" and I have asked 5 people. Results: Male = 3, Female = 2 My Spreadsheet therefore looks like this: A 1| Gender 2| Male 3| Female 4| Male 5| Female 6| Male Instead of: A | B 1| Gender 2| Male | Female 3| 3 | 2 I can't get a graph for the first one, but can for the second. You might be thinking why I don't want to use the 2nd method...

LOOKUPS
I am having a problem with one of my spreadsheets for my GNVQ I.T. coursework. Please help! My spreadsheet is for a boat hire company. On one table is a list of the boats, times to hire the boats and the cost to hire the boat for that amount of time. eg. Boat One | 2 hours | �25 (per head) Boat One | 3 hours | �35 (per head) Boat Two | 2 hours | �30 (per head) etc. etc. On another sheet, there is a table that lists the customers that have hired the boats, which boat they hired, how many people are on the boat and the time it has been hired for. eg. Mr R Brown | Boat One | 3 hours | 4 people ...

Serial Number Problem
Hi Everyone, we run Dynamics on our server anyway we had HUGE problems and lost a lot of work.....anyway after fixing lots up i still have one MAJOR problem. Serial numbers for items in the system do exist if you look up inventory ~ Serials. There is a list of serial numbers in stock ready to use. But when we go to do an invoice there are no serial numbers, it asks you if you want to overide the quantities... Our problem was we lost our inventory file therefore we had to put an old file back on...although these serial numbers are there we can not use them which also means i cant put t...

How to get polynome (or other type) coefficients of a trendline?
...

Duplicate Element Names in Serialized XML
Hi All, Hoping someone can solve a problem for me. I am modifying the schema for a rather complex web service written in VB.NET. The services uses a large number of serialized classes to output the overall XML. The problem I am having is that I require 2 XML elements of the same name to be serialized from the 1 class. Due to the way the web service is written only 1 of these would be ever be called at a time. However, it seems that I get an exception if the same element name is used twice in one class.. any ideas? For example: 'start class here <XMLElement ("elementName&q...

Need value looked up based on SMALL() result
I have a sheet like this: cat dog horse rat bird 9 6 8 1 3 I use the SMALL function to get the smallest three numbers G2=SMALL(A2:E2,1)=1 H2=SMALL(A2:E2,2)=3 I2=SMALL(A2:E2,3)=6 I need to find a function that will return the corresponding results rat bird dog Put this formula in G1: =INDEX($A$1:$E$1,MATCH(G2,$A$2:$E$2,0)) and copy across to H1 and I1. Hope this helps. Pete On Aug 3, 12:30 am, "Jorabi" <jor...@pobox.com> wrote: > I have a sheet like this: > > cat dog horse rat bird > 9 6 8 1 3 > > I use the SMALL function to...

Default Activity view page to phone call type
Anyone know how to default the Activity view page to the type phone call? Is there some jscript I can put in the OnLoad event? Thanks. ...

Assigning a value to a text
Hello, I'm currently doing somework in Excel and would greatly appreciate some help since I'm stuck. I've reached this part in which you have to calculate the dscounted price for each group of products. The discounts are ranged as Normal (5% discount), Special (10% discount), Exclusive (15% discount). When setting up you had to state what category each product was without indicating the % of discount. So I was wondering, if anyone knows how to *embed* the discount into the text, you know masking it. So any onlooker wouldn't notice it, but I can still calculate the discount. ...

Short date format in strongly typed dataset date column.
Is there a way to save date data in a short format rather than the long form which a strongly typed dataset saves it which looks like this: d3p1:WeekEnding="2003-02-02T00:00:00.0000000-06:00". I would like to shorten it like this: ="2003-02-02" Thanks. -- George Padvorac georgep@dontspamme-nwis.net ...

-> 2003: Plain text wrapping as I type? <-
Hi, I'm using Outlook 2003 and have set the auto wrapping to 76 for my plain text messages. At work, they autowrap as I type. At home I can type miles and miles of text without wrapping appearing in real time. It's wrapped only when sending the message. What's wrong? I'd like Outlook 2003 to wrap text as I type so I can know how the message will look like before sending it. I have applied all the patches. Any clue why I get the correct behavior at work (where I have Office 2003) and home (where I only have Outlook, without MS Office)??? Thanks for any help. Sincerely, St...

subtracting values in Access
Is there any way to subtract values in two different rows in Access? For example you have a 9 in row 1, and a 5 in row 2; Is there any way to subtract the two. I know you can run formulas across columns, but what about rows? You can but you have to control which record you are looking at. If you post your table structure, listing field names, datatype, and sample data someone ould suggest how. -- Build a little, test a little. "Hmkzoo" wrote: > Is there any way to subtract values in two different rows in Access? For > example you have a 9 in row 1, and...

Serial Motor
How do you control a motor via serial port? What language should I use? Justin Case wrote: > How do you control a motor via serial port? What language should I > use? I don't know, but it certainly isn't possible with SQL Server ... http://lmgtfy.com/?q=How+do+you+control+a+motor+via+serial+port -- HTH, Bob Barrows Bob Barrows (reb01501@NOyahoo.SPAMcom) writes: > I don't know, but it certainly isn't possible with SQL Server ... What? You can't control a motor with an engine? -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se...

value inputs..another formual question
Well I'm full of questions today...I'm really starting to understan Excel and I'm enjoying working with it. I'm making a sheet that will keep track of someone that is running tab with us. I'm inputting how much is owed on each specfic day, an the value's are added up and outputted in a "grand total" cell..... Now what happens when this person pays on the account, is there any wa I can input how much he pays which will be subtractred from the gran total, without destroying any information of past money spend (i wan to be able to keep a grand total, average ...

Excel Range Value issue (Excel 97 Vs Excel 2003)
Hi, I have some VB6 code which was originally written to populate a spreadsheet in EXCEL 97. Basically, to cut a long story short, what the code does is it populates a variant array by calling a stored procedure. The variant array in question is populated with 3 elements (a date, and 2 floats). The array is then passed to Excel like this. Dim xlRng As Excel.Range xlRng.Value = vntDataArray In my particular scenario, the first four rows have the following dates in the "dd/mm/yyyy" format. 29/11/1995 30/11/1995 01/12/1995 04/12/1995 These dates are exported perfectly to Excel 97...

serial port communuication
Hi all, I m communicating to a printer device through serial port.It is failing to open the port,but when I disable and enable the com port in device manager,it works fine(i.e)it communicates with the printer and reads the configuration settings of the printer). Regards Hari are u leaving the port opened when ur program terminates ........ what is the frequency of u disabling/enabling port ....... after every run ...... some times works some times not ..... ????? "hari" <haricibi83@gmail.com> wrote in message news:1171455246.402743.203120@k78g2000cwa.googlegrou...

Serialization of jagged Arrays Issue
Hi there, I m trying to return an object (of my own written class) from a web service that contains jagged Arrays as public variables. Asp.Net is showing me the its serialized version on the browser when i invoke the service during test. Code: public class returnType { [System.Xml.Serialization.XmlElementAttribute("chassisdata")] public _chassisdata[] chassisdata; [XmlArray(),XmlArrayItem("wheel", typeof(_wheel[]),IsNullable=false)] public _wheel[][] upsteps; [XmlArray(),XmlArrayItem("wheelsize", typeof(_wheelsize[]),IsNullable=false)] publi...

Word 2008 keeps crashing after a document is open, a few minutes after typing anything
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel For the last two weeks Word 2008 has been freezing after a open my document and start typing. The documents were created in word. I removed the &quot;Normal.dotm&quot; file as some suggested for similar issue. But it does not solve the problem. I reinstalled office with all updates again and nothing. PLEASE HELP! I'm writing a dissertation! <br><br>Here is the &quot;problem report for word&quot;. I'm sorry but is long. <br><br>Date/Time: 2010-05-10 21:20:20 -...

specifying Commtimeout values
Hi all, I need to set timeout values for readfile and writefile, the timeout for readfile is 300milliseconds and for writefile is 20seconds. I read the MSDN documentation, but I m not clear to specify the timeout values Can any one help on this. COMMTIMEOUTS cto; cto.ReadIntervalTimeout = ?; cto.ReadTotalTimeoutMultiplier=? cto.ReadTotalTimeoutConstant =?; cto. WriteTotalTimeoutMultiplier=?; cto. WriteTotalTimeoutConstant =?; Regards, Hari "hari" <haricibi83@gmail.com> wrote in message news:b54e5790-a4da-4c1b-b950-8c9986fb5a0c@e10g2000prf.googlegroups.com... > H...

getting value of named range
I have a named range. Lets say it goes over lots of cells. A1 to E20 Can I get the values out as a string? Single string. I have tried some things like: excel.Workbooks(MyWorkbook).Worksheets(MyWorksheet).Range(MyRange).value any ideas whoops, this should be in programming sorry "greg" <iuouh@ghfhg.com> wrote in message news:%23Ip5wsw0IHA.4164@TK2MSFTNGP03.phx.gbl... >I have a named range. Lets say it goes over lots of cells. > A1 to E20 > > Can I get the values out as a string? Single string. > > I have tried some things like: > > excel.Wo...

Use of Monotype Sorts Font and Value 4
When I enter in a cell the value 4 and change font to Monotype Sorts instead of getting a single CHECK-MARK I get the Check mark plus 3 other characters that look like a pencil stub. I only want to Check Mark. Any suggestions? TIA I can't replicate your problem. I get only a check mark. Are you sure there is nothing else in the cell. In another cell, use a formula like =LEN(A1) to ensure that there is only one character in the cell. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "JMay" <jmay@cox.net> wrote in ...

No text converter is installed for this file type
This is a multi-part message in MIME format. ------=_NextPart_000_0009_01CA6771.CB83FA70 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable Hi Expert=20 I am now facing a problem in opening a ppt in Powerpoint 2003, an error = display as follow: "PowerPoint can't read the outline from filename. No text converter is = installed for this file type." My platform status: 1. Windows XP Professional SP3 2. Microsoft Office 2003 SP3 3. Office 2007 Compatibility Pack installed Who can help me? TKNL __...