DataSet dset = new DataSet(); dset.ReadXml(FILENAME);
The error I got while Reading xml to dataset : Cannot add a SimpleContent column to a table containing element columns or nested relations.
I got to know what is causing the issue. My xml element that is causing issue looks something like below sample xml:(CreditCardDetail element is the one which is causing the issue as per my research on error. Also, this element data is not used later in our code so I need to somehow skip this element and load other elements data dynamically)
<PaymentData>
<Amount/>
<Change/>
<CreditCardDetail i:nil="true"/>
</PaymentData>
<PaymentData>
<Amount/>
<Change/>
<CreditCardDetail>
<CardNumber i:nil="true"/>
<Result i:nil="true"/>
</CreditCardDetail>
</PaymentData>
I am trying to read the xml(which is not in our control) to dataset and then access the datatable to save the data into sql tables. But since the nested element like above is causing error I am not sure how to go futher. Can somebody please guide me any alternative solution.