Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
internal struct pricingData // structure to hold the data received on each book received from website
{
internal string ISBN;
internal decimal listPrice;
internal struct bookInfoByVenue[]
{
internal string venueName;
internal bool newBook;
internal decimal price;
};
};
internal pricingData pD = new pricingData();
//this is a corrected version of your originally posted code
internal struct pricingData // structure to hold the data received on each book received from website
{
internal string ISBN;
internal decimal listPrice;
internal struct bookInfoByVenue
{
internal string venueName;
internal bool newBook;
internal decimal price;
}
}
//use this option if you want to have an array of structures
internal struct pricingData // structure to hold the data received on each book received from website
{
internal string ISBN;
internal decimal listPrice;
internal bookInfoByVenue[] myBookVen;
}
internal struct bookInfoByVenue
{
internal string venueName;
internal bool newBook;
internal decimal price;
}
//code for the structure setup
internal struct pricingData // structure to hold the data received on each book received from website
{
internal string ISBN;
internal decimal listPrice;
internal struct bookInfoByVenue
{
internal string venueName;
internal bool newBook;
internal decimal price;
}
internal bookInfoByVenue[] myVenue;
}
//this was in a form
private void Form1_Load(object sender, EventArgs e)
{
pricingData mydata = new pricingData();
mydata.myVenue = new pricingData.bookInfoByVenue[10];
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
I think what you want is something like
Open in new window