c# - How to Configure SQLCE connection on Smart Device Application using Emulator? -


i created simple test opens connection of sqlce located on desktop p.c. when start run debug mode throws me cant open connection. use pocket p.c 2003 emulator

this test code on smart device application.

connection string

private sqlceconnection conn = new sqlceconnection("data source=c:\\sdb.sdf"); 

test connection

public bool test()  {     try     {         conn.open();         {}         status.text = "connected";     }     catch (exception ee)      {         throw ee;         status.text = "not connected";      }         {         if (conn.state == connectionstate.open) conn.close();      }     return true;  } 

is there things need configure?thanks in regards!

that's correct behavior. aspects, emulator physical device nesxt pc. doesn't know pc drives (you can share pc folder going emulator configuration) , therefore can't see them. doesn't know drive letters.

if want emulator use file on pc, again can share folder file in, located @ \storage card\myfile.sdf. note shared folder gets mounted "storage card" on emulator.

i'd still recommend not doing this, though, since it's not @ extensible or scalable. real solution isn't going running on emulator on pc it? happens when test on real hardware can't share folder emulator? i'd should deploying database file device, whether that's emulator or real iron.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -