//My basic XML schema is: <Ingredients> <Item> <Name>Eggs</Name> <Amount>5 Pounds</Amount> <Description>scrabled</Description> </Item> <Item> <Name>Eggs</Name> <Amount>5 Pounds</Amount> <Description>scrabled</Description> </Item> </Ingredients> //The XSD file shows this <xs:element name="Ingredients"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Item"> <xs:complexType> <xs:sequence> <xs:element name="Name" type="xs:string" /> <xs:element name="Amount" type="xs:string" /> <xs:element name="Description" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> /*I know I am doing the XSD to CS conversion with the XSD command line tool reasonably well. I can make this work if I don't include the arrays. But once I try to use them, the main C# code complains that I need to include a type in my declarations. */ //This is the code I put in main, //after creating the public partial class calls. //Trying to create 3 ingredient objects with each object //Having a .Name .Amount and .Description string items rcpPage.Ingredients[] = new string[3]; rcpPage.Ingredients[0].Name = "eggs"; rcpPage.Ingredients[0].Amount = "50 Pounds"; rcpPage.Ingredients[0].Description = "Chopped Find as frog fur"; rcpPage.Ingredients[1].Name = "Lettuce"; rcpPage.Ingredients[1].Amount = "A Pinch or two"; rcpPage.Ingredients[1].Description = "Frozen like a brick"; rcpPage.Ingredients[2].Name = "Cat Fur"; rcpPage.Ingredients[2].Amount = "About 4 pounds"; rcpPage.Ingredients[2].Description = "Dry very dry";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)