need help with SqlCeConnection and app.config

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sl1ver
    New Member
    • Mar 2009
    • 196

    need help with SqlCeConnection and app.config

    i can't get the mobile app to make a connection from the app.exe.config but if i hard code the DB path it connects. ConfigurationMa nagerCE is a seperate class
    Code:
    app.config.exe
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <appSettings>
        <add key="MobileDBPath" value="\Program Files\Mobile\qxAsset.sdf" />
        <add key="WebService" value="http://JM-QwixWHv2/asset/SyncService.asmx" />
        <add key="CSVPaths" value="\Program Files\Mobile" />
      </appSettings>
    </configuration>
    and here is the connection coding
    Code:
    SqlCeConnection myConn = new SqlCeConnection();
                string strConn = ConfigurationManagerCE.AppSettings["MobileDBPath"].ToString();
                myConn.ConnectionString = strConn;
                myConn.Open();
    whats wrong with connection coding?
    Last edited by tlhintoq; Mar 19 '09, 01:27 PM. Reason: Please use [CODE] ... your code here ... [/CODE] tags
Working...