views:

19

answers:

0

I have an XSD file with various elements like

<xs:element name="a1" type="xs:int" /> 
<xs:element name="b1" type="xs:string" />
<xs:element name="c1" type="xs:unsignedByte" />

etc. based on conditions in code i assign

 DataRow drXML = xmlDoc.DataSet.Tables["COLLECTION"].NewRow();

for ex: drXML["b1"] = dr.GetString("b1"); (this dr is a reader from DataReader dr, drXML is a datarow which gets entries from XSD.

Condition is

if(a>0) //For ex:
{
    drXML["b1"] = dr.GetInt32("a1"); 
    drXML["b1"] = dr.GetString("b1"); 
}

If i don't get a>0, will the values in XSD cause any exception or should i need to add a default value for XSD elements.