Hi..
I am working in visual studio 2005 working on dataset.
having fallowing code which is not working well getting lots of error.
public static XmlSchemaComplexType GetTypedTableSchema(XmlSchemaSet xs)
{
XmlSchemaComplexType schemaComplexType = new XmlSchemaComplexType();
XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
DarusSalamDataSet darusSalamDataSet = new DarusSalamDataSet();
xs.Add(darusSalamDataSet.GetSchemaSerializable());
XmlSchemaAny xmlSchemaAny1 = new XmlSchemaAny();
xmlSchemaAny1.Namespace = "http://www.w3.org/2001/XMLSchema";
xmlSchemaAny1.MinOccurs = new Decimal(0);
xmlSchemaAny1.MaxOccurs = new Decimal(-1, -1, -1, false, (byte) 0);
xmlSchemaAny1.ProcessContents = XmlSchemaContentProcessing.Lax;
xmlSchemaSequence.Items.Add((XmlSchemaObject) xmlSchemaAny1);
XmlSchemaAny xmlSchemaAny2 = new XmlSchemaAny();
xmlSchemaAny2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
xmlSchemaAny2.MinOccurs = new Decimal(1);
xmlSchemaAny2.ProcessContents = XmlSchemaContentProcessing.Lax;
xmlSchemaSequence.Items.Add((XmlSchemaObject) xmlSchemaAny2);
schemaComplexType.Attributes.Add((XmlSchemaObject) new XmlSchemaAttribute()
Name = "namespace",
FixedValue = darusSalamDataSet.Namespace
);
schemaComplexType.Attributes.Add((XmlSchemaObject) new XmlSchemaAttribute()
{
Name = "tableTypeName",
FixedValue = "UsersDataTable"
});
schemaComplexType.Particle = (XmlSchemaParticle) xmlSchemaSequence;
return schemaComplexType;
}
please help me.
THanks
Loading

Jignesh TrivediRank #16 · 50.3K reputationPosted Jun 23, 2013, 7:30 PM EDT
hi,
i am getting compilation error while adding attribute to schemaComplexType object.
and i replace following code it work fine.
schemaComplexType.Attributes.Add((XmlSchemaObject)new XmlSchemaAttribute
{
Name = "namespace",
FixedValue = darusSalamDataSet.Namespace,
});
hope this will help you.
Kanhialal kkRank #8,477 · 221 reputationPosted Jun 23, 2013, 10:11 PM EDT
but i have a question that would that work after replacing the above code you have mentioned.....??
Jignesh TrivediRank #16 · 50.3K reputationPosted Jun 23, 2013, 10:22 PM EDT
I have just replace following line with above mention line.
schemaComplexType.Attributes.Add((XmlSchemaObject) new XmlSchemaAttribute()
Name = "namespace",
FixedValue = darusSalamDataSet.Namespace
);
Kanhialal kkRank #8,477 · 221 reputationPosted Jun 24, 2013, 6:19 AM EDT
am Pleased