Symptoms
- MobileAsset v7 is being used on a Windows Mobile/CE device.
- At initial download of the database to the device, user chose to store the database on a memory card.
- When editing, auditing, or other operation where an asset tag is entered, one or more error messages appear:
NullReferenceException
Database error while trying to locate an existing asset.: NullReferenceException
Cause
The MobileAsset.sdf database file is saved in the root of the memory card, but the program expects the database file to be in at least one folder.
Workaround
- Before the initial database download, create a folder on the memory card (suggested name: Database), using Windows Explorer on the mobile device, or Windows File Explorer on the PC. At initial download time, specify this folder.
- Or, if the database is already on the memory card, move the file and update the path in the configuration file:
- Quit MobileAsset on the device.
- Connect the mobile device to the PC so that it shows connected in Windows Mobile Device Center.
- In WMDC or Windows File Explorer, browse the contents of the device.
- Go into the memory card (which could be called Flash Disk, SDMMC, or some other name). Create a folder there (suggested name: Database), then move the MobileAsset.sdf file into the folder.
- Edit the configuration file: Copy the device's file \Program Files\MobileAsset\service.config to the PC, then open the PC's copy of the file in Notepad or other text editor. Add the folder name you created in Step 2d into the <SdfPath> section, then save the file. For example:
original:
fixed: - Copy the file back to the device, replacing the original.
- Now the device can be used as expected, and the error should no longer appear.