DataSet to XMLDataDocument - change tag names
-
When I convert my DataSet to an XMLDataDocument, the XML result looks something like this:
<NewDataSet>
<Table>
<ID>123</ID>
<Name>Bob</Name>
</Table>
</NewDataSet>How do I specify what the tagnames should be of the root and row elements? I would like my result to be something like this:
<Employees>
<Employee>
<ID>123</ID>
<Name>Bob</Name>
</Employee>
</Employees>Is the only way to do this by first reading an XML schema into the DataSet? If so, is there a way to write the schema in such a way that only the root and row elements are renamed, but the column elements are processed as is?
-
When I convert my DataSet to an XMLDataDocument, the XML result looks something like this:
<NewDataSet>
<Table>
<ID>123</ID>
<Name>Bob</Name>
</Table>
</NewDataSet>How do I specify what the tagnames should be of the root and row elements? I would like my result to be something like this:
<Employees>
<Employee>
<ID>123</ID>
<Name>Bob</Name>
</Employee>
</Employees>Is the only way to do this by first reading an XML schema into the DataSet? If so, is there a way to write the schema in such a way that only the root and row elements are renamed, but the column elements are processed as is?
I'm just hazarding a guess here, but couldn't you set the DataSetName and DataTableName properties of your data structure/object. some semi-pseudocode
dsEmployees.DataSetName = "Employees"
dsEmployees.Tables[0].DataTableName = "Employee"Or I could be spouting a load of bull :-) Bruce Duncan CP#9088, CPUA 0xA1EE, Sonork 100.10030
Hi everyone. My name's Bruce. And I suffer from VB. -
I'm just hazarding a guess here, but couldn't you set the DataSetName and DataTableName properties of your data structure/object. some semi-pseudocode
dsEmployees.DataSetName = "Employees"
dsEmployees.Tables[0].DataTableName = "Employee"Or I could be spouting a load of bull :-) Bruce Duncan CP#9088, CPUA 0xA1EE, Sonork 100.10030
Hi everyone. My name's Bruce. And I suffer from VB.It works :) (except that it's TableName instead of DataTableName). Thanks!