Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7893601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:10:27+00:00 2026-06-03T07:10:27+00:00

I have created an ASP.NET 3.5 Website and added mobile forms to it through

  • 0

I have created an ASP.NET 3.5 Website and added mobile forms to it through third party templates (since the VS designer doesn’t support the old templates any more). Now I want to use some database handling in my application which will be tested using a Windows Mobile 6.0 emulator. I wrote the following code to create a database programmatically using SQL Server Compact CE 4.0:

SqlCeEngine engine = new SqlCeEngine("Data Source=Program Files\\Calculator\\Calc.sdf;password=abcd");
engine.CreateDatabase();

However, no matter how I tweak the path, I always get the error, "The path is not valid. Check the directory for the database". I have tried various combinations of the connection string but in vain. Nothing works.

Edit

I have also seen various other threads here and elsewhere on this issue but nothing seems to solve the problem in this case. I even tried the other folders like My Documents as shown below but it didn’t work:

SqlCeEngine engine = new SqlCeEngine("Data Source='\\My Documents\\Calculator\\Calc.sdf';password=abcd");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:10:28+00:00Added an answer on June 3, 2026 at 7:10 am

    I eventually figured it out myself. It seems that the .sdf is only being accessed from the local machine/server from where I am deploying my application. Therefore, the path will relate to the server, in this case, my local machine.

    Thus for me, this is the code that worked successfully:

    path = Server.MapPath("~/App_Data");
        
    SqlCeEngine engine = new SqlCeEngine("Data Source='" + path + "\\Calculator.sdf';password=abcd");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a asp.net website and i added tooltip to a button by
I have created a ASP.NET website and deploy it in IIS 7 (in place
I've created a website with ASP.NET MVC. I have a number of static pages
I have asp.net application. and I have created mobile version of it which is
I have created an asp.net website, with the accompanying app_code folder. In the same
I have created a website using ASP.Net and running on port 8080. When server
I have a website created with ASP.NET and a web service, both using FormsAuthentication
i am developing a website using asp.net 3.5.i have created a cascading dropdownlist for
I am developing a website by ASP.Net. I have created settings/first-run page which I
I have created firstly ASP.NET MVC 2 . and write more functionality. After I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.