473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

incrementing an array with in an array during xml serialization

I'm unable to increment the index in an array in which I'm stuffing another array. Would someone help me with this

I'm inserting the namespace in this mail so you can see my code. thanks ahead of tim

using System
using System.IO
using System.Xml
using System.Xml.Schema
using System.Xml.Serialization
using EXstub

namespace xmltex

/// <summary
/// Summary description for xmlTest
/// </summary
[Serializable
public class xmlTes

public xmlTest(

/
// TODO: Add constructor logic her
/

[Serializable
public class Mak

[XmlAttribute(AttributeName="makeame")
public string MakeName
[Serializable
public class Mode

[XmlAttribute(AttributeName="modelname")
public string ModelName

[Serializable
public class Yea

[XmlAttribute(AttributeName="year")
public string YearMade

[Serializable
[XmlRoot(ElementName="vehicles")
public class Vehicl

[XmlArrayAttribute("makes")
[XmlArrayItemAttribute("make")
public Make[] Makes

[XmlArrayAttribute("models")
[XmlArrayItemAttribute("model")
public Model[] Models

[XmlArrayAttribute("years")
[XmlArrayItemAttribute("year")
public Year[] Years

public class Serializer

public Serializer(

/
// TODO: Add constructor logic her
/
public Vehicle serializer(

Vehicle vehicle = CreateVehicle()

XmlSerializer serializer = new XmlSerializer(typeof(Vehicle))
using (FileStream stream = File.OpenWrite("Vehicle.xml"))

serializer.Serialize(stream,vehicle)
return vehicle
private static Vehicle CreateVehicle()
EXstub.dummy exStub = new EXstub.dummy()
string[,] returnArray = exStub.buildArray();
Vehicle vehicle = new Vehicle()
Make make = new Make()
Model model = new Model()
Year year = new Year()

int rows = returnArray.GetLength(0); // Length of first dimensio
int columns = returnArray.GetLength(1); // Length of second dimensio

for(int row = 0; row < rows; ++row)

make.MakeName = returnArray[row,0];
Make[] manufactor = {make}
These are the vehicle.Makes = manufactor
line, same for each

model.ModelName=returnArray[row,1]
Model[] style = {model}
vehicle.Models = style
year.YearMade=returnArray[row,2]
Year[] yr = {year}
vehicle.Years = yr
return vehicle


Nov 22 '05 #1
0 804

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

Similar topics

2
by: Britt Ward | last post by:
I'm unable to increment the index in an array in which I'm stuffing another array. Would someone help me with this I'm inserting the namespace in this mail so you can see my code. thanks ahead...
3
by: Franz | last post by:
Let me describe the flow of my program first. 1. Deserialize data from xml file. 2. Addition of "PersonType" class to the AllPersonalData. 3. Serialize data back to the xml file. My question is...
11
by: Rangi Keen | last post by:
I am instantiating an XmlSerializer using the XmlSerializer(Type) constructor. This works most of the time, but sometimes I get a timeout during the process. I'm using the same type in all cases...
1
by: Michal Piatkowski | last post by:
I have a problem with serialization of a polymorphic array. It has attributes defined XmlArray and XmlArrayItem for XML serialization. The attribute specifies Type1 but as my array is polymorphic...
1
by: elziko | last post by:
My intention is to store an array of singles inside a DataTable so that it can me peristed somehow, maybe XML file, maybe Access/SQL Server I don't know yet so I'm just saving it as an XML file for...
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
0
by: Chris McDonough | last post by:
ElementTree's XML serialization routine implied by tree._write(file, node, encoding, namespaces looks like this (elided): def _write(self, file, node, encoding, namespaces): # write XML to file...
0
by: SaharImtiaz | last post by:
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...
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
9
by: subramanian100in | last post by:
The following portion is from c-faq.com - comp.lang.c FAQ list · Question 6.13 int a1 = {0, 1, 2}; int a2 = {{3, 4, 5}, {6, 7, 8}}; int *ip; /* pointer to int */ int (*ap); /* pointer to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.