0

My problem is basically the same as in the post below, but on Windows Mobile 6:

Local database, I need some examples

In short: I need a local database accompanying the executable, and I'm trying to do that using the CE database. In the first reply under the post above there is a solution, though it doesn't work on Mobile, i.e. this line can't compile:

string dbfile = new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName + "\\datafile.sdf";

And that's due to lack of the "Location" attribute.

What's the solution? I'm quite new to databases on .Net, and documentation on MSDN is too vague for me to help.

Community
  • 1
  • 1
rox004
  • 1

2 Answers2

0

SQLite is the best solution for your problem statement. Itz a self-contained, serverless, zero-configuration, transactional SQL open source database engine. It occupies few KB; but manages the storage upto 2GB. Nokia is SQLite Consortium member. I tried in one of the tool developement; itz powerful. Get more info at http://www.sqlite.org/

Ganesan
  • 73
  • 5
0

SQL CE should be fine. I am a bit confused on whether you are refering to on the mobile device or on a computer because you mention "it doesn't work on Mobile", and indeed the compact framework doesn't support the call to location. Some clarification on what you are specifically trying to do would help.

On the mobile device try

System.IO.Path.GetDirectoryName( 
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);

To get the folder path.

King
  • 339
  • 1
  • 5