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

  • SEARCH
  • Home
  • 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 1088069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:01:22+00:00 2026-05-16T23:01:22+00:00

I am creating an app for my work to track behavior management over the

  • 0

I am creating an app for my work to track behavior management over the course of a school year. To do this, I obviously needed a database. I built the program so that it would, when opened, check to see if the database exists, and if it doesn’t, it creates one, and inputs the schema. This works perfectly on my dev computer, but when I switch it to a computer using windows XP it gives an error saying system.io.filenotfoundexception. I can’t figure out why it won’t create the database.
I am using Visual C# 2010 Express. And the database is made in sql server ce.

        if (!File.Exists("chart.sdf"))//Checks if file is already in existance when app is opened
        {
            dbCreated = createDb();//If there is no database, creates one
        }


public bool createDb()//Creates the database if needed
    {
        bool success = true;
        //Holds sql schema for the table
        string[] tableCreateArr ={"create table childNameId"
                 + "(childId INT IDENTITY PRIMARY KEY, "
                 + "childFName nchar(40), "
                 + "childLName nchar(40));",
                "create table leaderNameId"
                + "(leaderId INT IDENTITY PRIMARY KEY, "
                + "leaderFName nchar(40), "
                + "leaderLName nchar(40));", 
                "create table TagPulledId"
                 + "(tagId INT IDENTITY PRIMARY KEY, "
                 + "childId INT, "
                 + "leaderId INT, "
                 + "day TINYINT, "
                 + "month TINYINT, "
                 + "year INT);",
                 "CREATE TABLE tagInfo"
                 + "(tagId INT, "
                 + "color nchar(10), "
                 + "description ntext)"};

        SqlCeEngine dbCreate = new SqlCeEngine(connectString());  // creates the database obj

        dbCreate.CreateDatabase(); // creates the database file
        SqlCeConnection tempConnect = new SqlCeConnection(connectString());//Connects to the new database
        SqlCeCommand objCmd = new SqlCeCommand();//Creates an sql command obj
        tempConnect.Open(); // opens the connection
        objCmd.Connection = tempConnect; //Connects the command obj

        foreach (string strCmd in tableCreateArr)//Iterates throught he sql schema to create the tables
        {
            try
            {
                objCmd.CommandText = strCmd; //sets the CommandText to the next schema entry in the array
                objCmd.ExecuteNonQuery(); //Executes the create query
            }
            catch (SqlCeException sqlError)
            {
                MessageBox.Show(sqlError.Message, "SQL Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                success = false;
            }
        }
        tempConnect.Close();
        return success;
    }

I can’t figure out why the app isn’t making the database, it seems to work on some computers, while not working on others. Any help would be great! Thank you.

  • 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-05-16T23:01:23+00:00Added an answer on May 16, 2026 at 11:01 pm

    Make sure you have deployed all the dll Sql Server Compacts need. I’m not sure you get them when you install .NET framework. The dll needed are :

    • sqlceca35.dll
    • sqlcecompact35.dll
    • sqlceer35EN.dll
    • sqlceme35.dll
    • sqlceoledb35.dll
    • sqlceqp35.dll
    • sqlcese35.dll

    You can find more details on this MSDN page about Sql Compact Deployment for various versions of the database engine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an app that needs to be accessed by both a web front
I am creating a small app to teach myself ASP.NET MVC and JQuery, and
I'm creating a small app in ASP.NET MVC that generates ics (iCal) files based
I'm creating a WPF app and have a system tray icon with a context
I'm creating an WPF app, so I'm mostly working with the ImageSource class for
On my app i am creating a real time trace (not sure how yet
I'm creating an asp.net app with just some lite data access from xml files.
I am creating a small console app that needs a progress bar. Something like...
I am just learning about app.config in respect of creating custom sections. I have
My record sheet app has a menu option for creating a new, blank record

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.