C
Chris
Alright,
Ive just began diving into the lovely world of .net cf dev. I have an
xml file similar to the one below:
<Root Database="accvalquery.xml">
<Structure>
<Field>
<Field_Name>QNAME</Field_Name>
<Field_Type>Character</Field_Type>
<Field_Len>10</Field_Len>
<Field_Dec/>
</Field>
<Field>
<Field_Name>QTXTVAL</Field_Name>
<Field_Type>Character</Field_Type>
<Field_Len>49</Field_Len>
<Field_Dec/>
</Field>
<Field>
<Field_Name>QVAL</Field_Name>
<Field_Type>Character</Field_Type>
<Field_Len>4</Field_Len>
<Field_Dec/>
</Field>
</Structure>
<Information>
<Record>
<QNAME>rover</QNAME>
<QTXTVAL>metro</QTXTVAL>
<QVAL>1</QVAL>
</Record>
<Record>
<QNAME>rover</QNAME>
<QTXTVAL>214</QTXTVAL>
<QVAL>2</QVAL>
</Record>
<Record>
<QNAME>Citroen</QNAME>
<QTXTVAL>Zara</QTXTVAL>
<QVAL>1</QVAL>
</Record>
</Information>
</Root>
Below is the code i have written to access this file and perform a
filter to only get me certain records then add them to the combo box.
Currently it takes about 5secs although this hasnt been timed
properly. Before i continute to use this method on other files (100
records or so) would like some experts to tell me if this the fatest
(and most efficient) way?
Dim ds As New DataSet
Dim datar As DataRow
ds.ReadXml("/Program
Files/SmartDeviceApplication1/accvalquery.xml")
Dim foundRows As DataRow() = ds.Tables(3).Select("QNAME =
'rover'")
Dim r As DataRow
Dim c As DataColumn
For Each r In foundRows
ComboBox1.Items.Add(CType(r(1), String)) ' add the model
Next r
Thanks
Chris
Ive just began diving into the lovely world of .net cf dev. I have an
xml file similar to the one below:
<Root Database="accvalquery.xml">
<Structure>
<Field>
<Field_Name>QNAME</Field_Name>
<Field_Type>Character</Field_Type>
<Field_Len>10</Field_Len>
<Field_Dec/>
</Field>
<Field>
<Field_Name>QTXTVAL</Field_Name>
<Field_Type>Character</Field_Type>
<Field_Len>49</Field_Len>
<Field_Dec/>
</Field>
<Field>
<Field_Name>QVAL</Field_Name>
<Field_Type>Character</Field_Type>
<Field_Len>4</Field_Len>
<Field_Dec/>
</Field>
</Structure>
<Information>
<Record>
<QNAME>rover</QNAME>
<QTXTVAL>metro</QTXTVAL>
<QVAL>1</QVAL>
</Record>
<Record>
<QNAME>rover</QNAME>
<QTXTVAL>214</QTXTVAL>
<QVAL>2</QVAL>
</Record>
<Record>
<QNAME>Citroen</QNAME>
<QTXTVAL>Zara</QTXTVAL>
<QVAL>1</QVAL>
</Record>
</Information>
</Root>
Below is the code i have written to access this file and perform a
filter to only get me certain records then add them to the combo box.
Currently it takes about 5secs although this hasnt been timed
properly. Before i continute to use this method on other files (100
records or so) would like some experts to tell me if this the fatest
(and most efficient) way?
Dim ds As New DataSet
Dim datar As DataRow
ds.ReadXml("/Program
Files/SmartDeviceApplication1/accvalquery.xml")
Dim foundRows As DataRow() = ds.Tables(3).Select("QNAME =
'rover'")
Dim r As DataRow
Dim c As DataColumn
For Each r In foundRows
ComboBox1.Items.Add(CType(r(1), String)) ' add the model
Next r
Thanks
Chris