I am reading a schema with two DataTables and loading into a dataset.
In my intial tests I was using a web form. Everything was running
great so I convert it over to a class. Now I am getting
"System.InvalidCastException: Specified cast is not valid". I have
checked to make sure the same name spaces are included, they seam to
be the same in both web form and class.
Thanks in advance for help you can give
Here is the code
//Load schema using XmlSchema's Read() method
ads_working = new DataSet("PB_TABLES");
XmlTextReader reader = new XmlTextReader(ls_schemaPath);
XmlSchema schema = XmlSchema.Read(reader,null);
// this level is the PB_TABLES root no work needed here
XmlSchemaElement PBTablesElem = (XmlSchemaElement)schema.Items[0];
XmlSchemaComplexType PBTablesComplexType =
(XmlSchemaComplexType)PBTablesElem.SchemaType;
// this line causes the errror
XmlSchemaSequence PBTablesSeq= (XmlSchemaSequence)
PBTablesComplexType.Particle;