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 8043767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:00:52+00:00 2026-06-05T05:00:52+00:00

I have developed a .NET desktop application which uses SQL Server 2005 SP3 Express.

  • 0

I have developed a .NET desktop application which uses SQL Server 2005 SP3 Express.

After installing the SQL Server Express runtime and application on a Windows 7 64 bit machine, I get the following error after launching the application:

System.Data.SqlClient.SqlException: Failed to generate a user instance
of SQL Server due to a failure in starting the process for the user
instance. The connection will be closed.

The connection string I have used in the <application>.exe.config file is :

<add name="cs" connectionString="Data Source=.\SQLEXPRESS;
    AttachDbFilename=|DataDirectory|\AppData\MWAIWFMLE1.mdf;
    Integrated Security=True;
    User Instance=True"
    providerName="System.Data.SqlClient" />

The MWAIWFMLE1.mdf file is located in a folder called AppData in the application install directory under program files – hence the AppData in the AttachDbFileName path.

Am I missing something here?

  • 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-05T05:00:54+00:00Added an answer on June 5, 2026 at 5:00 am

    Read this very good overview of what user instances really are.

    In a nutshell:

    • SQL Server allows you to have multiple instances of itself on a single computer – the default instance can be accessed using just the machine name (or IP address) of the host machine – all other instances need to be specified by an instance name (like the SQLExpress on your machine)

    • for development purposes, you can also create a user instance – each user gets their own separate instance of SQL Server (works in the Express edition only) and a database is attached by its file name (path\Sales_DB.mdf) to that user instance. This instance is started up on demand, then runs and is shut down when no longer needed

    While this works great for development, it’s not really intended for later on – certainly not for production use.

    In a production environment, you want to attach your database files to the actual SQL Server instance they should run on – typically using SQL Server Management Studio. When you do this, you no longer refer to that database via its file name, but instead you use the database name that was given to the database when being attached to the server. In this case, SQL Server will handle all details of operations – and that SQL Server instance is up and running all the time (doesn’t need to be started “on demand” all the time), and you can use things like permissions and logins to control access to the database.

    Your connection string would then look something like this:

    <connectionStrings>
        <add name="Sales_DBEntities" 
             connectionString="server=.\SQLEXPRESS;Database=YourDatabaseNameHere;Integrated Security=SSPI;" />
    </connectionStrings>
    

    When you have attached a database to a production (or testing) SQL Server instance, you do not need to know what the files are that make up the database, and you don’t need to specify those files – SQL Server will take care of that. You just refer to the database via its database name.

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

Sidebar

Related Questions

I have developed a desktop application (.NET 2.0) and it needs to get some
I have a desktop application of address diary, developed in C# .Net. I want
i have developed one windows (desktop) based application which sends pdf as an attachments.
I have a C# (.net 3.5) desktop application which prints out some numbers on
I have developed an asp.net application and windows desktop application system. My clients can
In the company I work for we have a desktop application developed in .NET
I'm a little confused. We have developed an net 4.0 application. We use nhibernate
I have developed an ASP.NET MVC (version 2 RC) application with a ton of
I have developed my application in .Net and my installer is working fine. Now
I have developed a MVC web application with ASP.NET MVC and im just wondering

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.