0

Does anyone know how to open a sqlite database in windows mobile 6.5(emulator)? I have tried to use the following code to open it, but it has no success. It says "Unable to open the database".

private SQLiteConnection con;

public void OpenDB(){

con = new SQLiteConnection(@"Data Source=C:\Documents and Settings................\Data\iPhysioMobile");

con.open();

}

I have used to use the full path of the database file. Does anyone know why it occurs? or any other suggestions?

Regards,

SW Lau

Charles LAU
  • 281
  • 1
  • 8
  • 19

1 Answers1

0

No wonder this code is not working.

The path is invalid. There is no such drive as C:\ in windows mobile.

Location ("C:\Documents and Settings................\Data\iPhysioMobile") shared by your computer and windows mobile is from computer point of view not windows mobile.

To know folder in windows mobile from where your app is running, use Directory.GetCurrentDirectory. Then open .db file from that location.

Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208