I’m trying to perform validation on serial #s on a PocketPC PDA/phone device — the Siemens SX66, also branded under SprintPCS and Verizon as a different device, but still the same puppy.
The file is huge. 14,000 serial #s, thus a very large XML. I hate XML files that are that long — just think of the wasted space in those tags — the cost to pay for meta-data.
The xml file looks like:
<?xml version=”1.0″ encoding=”utf-8″?>
<validate xmlns=”http://usmicrocorp.com/validate.xsd”>
<items>
<row sn=”111″ />
<row sn=”222″ />
<row sn=”333″ />
…
</items>
</validate>
The code looks like:
dsValidate.ReadXml(GetAppPath() + “validate.xml”);
dsValidate.Tables[”row”].PrimaryKey = new DataColumn[] {dsValidate.Tables[”row”].Columns[”sn”]};
…
strSelect = “sn=’” + txtSerialNumber.Text + “‘”;
dr = dsValidate.Tables[”row”].Select(strSelect);
if (dr.Length > 0) {
// we found a duplicate
}
Oh, but man is that slow on the phone with a sufficiently large dataset. The poor little arm processor can’t build that primary key in under 5 minutes. Just sits there, and at the end actually errors out (throwing an exception), but then goes on to let me validate very quickly (the select statements) all the #s I tried.
Anyone know of any quick data structures (hash buckets, etc.) that a dinky little ARM processor might be able to handle?
In the meantime, I may migrate it over to a Web Service, but that’s a lot of overhead for a quick serial # scan from a barcode scanner, then a call to a web-service, even if it’s over the SprintPCS network. Wifi, maybe?