W
Wapiti
Thanks Ginny,
That sounds very similar to the approach I've taken with older DOS handheld
units. Reading the whole file into memory is a scary approach, but workable.
I suppose then, that at program close, you send whats in memory back to the
file? Or provide a flush option to the user?
In terms of deletions, again, that is what I have done in older DOS apps -
and I agree, it works well. When I export the file to the appropriate
format required by the host, I just don't send those records (flagged as
deleted).
Something that came to mind, does anyone know what Microsoft uses for data
storage for applications like their onboard Calendar? Its storing data
somehow, and its not all that slow. If its sqlce, then its already onboard,
right?? If its not, what is it?
Thanks again,
Mike
That sounds very similar to the approach I've taken with older DOS handheld
units. Reading the whole file into memory is a scary approach, but workable.
I suppose then, that at program close, you send whats in memory back to the
file? Or provide a flush option to the user?
In terms of deletions, again, that is what I have done in older DOS apps -
and I agree, it works well. When I export the file to the appropriate
format required by the host, I just don't send those records (flagged as
deleted).
Something that came to mind, does anyone know what Microsoft uses for data
storage for applications like their onboard Calendar? Its storing data
somehow, and its not all that slow. If its sqlce, then its already onboard,
right?? If its not, what is it?
Thanks again,
Mike
Ginny Caughey said:I use a text file format similar to CSV. I separate records by CRLF and
fields by the pipe symbol. I read in the whole file when the program loads
and parse the parts into collections of business objects primarily using
StreamReader.ReadLine, String.Split, and various members of the Convert
class. (This is indeed the slowest part, but it's many times faster than
parsing XML and it only happens once when the app loads.) Whenever I need to
add a record to a file, I add it to the memory collection and I also append
a record to the text file itself. (This is fast.) If I need to delete or
modify a record, I use a special code in a new record I append that
indicates that the record is deleted or modified. This approach works well
for reasonably small amounts of data - a few thousand records - but it
requires a desktop app that can play back the log files and update
enterprise data correctly as well as the intelligence in the device app to
correctly interpret the files. But for large amounts of data requiring a
storage card, I would certainly use SqlCe instead rather than trying to keep
all the data in memory all the time.
I think for the volume of data you're expecting that you have a number of
options. I recommend trying several and see what you like, but I don't
recommend XML unless the data volume is very small.
--
Ginny Caughey
.Net Compact Framework MVP
useWapiti said:So, what method do you use then, for accessing your text files? In the
Compact Framework? And how many records are you accessing - do you perform
record(column) modifications with the collection data? If so, how?
Regular text files seem like they would consume a lot of time.
than,
for wherejustaDOTbig
text file anyway?
I've never used xml - maybe now is the time to try??
Input appreciated.
Mike
"SetFilePointer" is a cool function but it does not provide TRUE random
access like the days of old.
Take a look at this thread:
http://www.xtremevbtalk.com/archive/index.php/t-179063.html
Thanks,
Noble
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam
com>thenwrote in message You can call anything in any DLL anywhere on the device, but you have
to
write your own declarations. That's what P/Invoke is: Platform
Invoke.
You
declare the functions which are found in DLLs as externs and
callrunthem,
passing suitable parameters. If you feel like something is missing,
then
you haven't been involved in .NET CF development long enough, yet.
Download the OpenNETCF SDF and look through the source code. A huge
percentage of what is done there is working around the lack of managed
code
wrappers for Win32 API functions. In fact, CreateFile, WriteFile,
ReadFile
and, maybe, SetFilePointer, are in there.
Paul T.
code
that guys
are worth
ofon device
(as for
the