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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:26:40+00:00 2026-06-10T05:26:40+00:00

I am developing C# windows application first time. Que 1 – ) I have

  • 0

I am developing C# windows application first time.

Que 1 – ) I have developed my windows application which uses SQL server 2008 using below connection string..

Data Source=myMachineName;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

But When I created setup of my application and installed it to another computer then it is throwing error of could not establish connection with SQL server..

I guess this error is because of my connection string as it is specific to my computer and installing it to another computer will not work..

Hence How can I make my connection string which will work with any computer..

Que 2 – Do I need to attach schema file with my setup as How my database will be created into the other computers??

This might be silly qustion but as I am doing this first time , i dont know about this all.

enter image description here

Regards,
Mahesh

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

    If you’ve used SQL Server on your development machine, it has to be installed on every computer that will be using your app. There are several options to resolve this issue:

    If your app doesn’t need access to a central sql server (for example your app just keeps track of users DVDs), use SQL Server Compact Edition instead and embed it to your app

    If your app needs some kind of a centralized data, get a dedicated SQL server first, install there everything you need and in your app change your current myServerAddress to the address of the server. Note that the server needs to be accessible from remote locations (some restrict access to localhost!).

    Que 2 – Do I need to attach schema file with my setup as How my
    database will be created into the other computers??

    Again, multiple options. For instance, you can export your database to a .sql file (Right click on the db in your DB explorer and select option Publish to provider) and then import it using a sql manager on other computers. Or maybe you can create a .cs installation script, that will do the same job using C# code.

    Edit based on OP’s comments:

    Example links for solutions:

    question1: Embedding SQLServer CE in an installer
    question2: http://support.microsoft.com/kb/307283

    Okay that’s fine but will my current Connection string work in that case as the DataSource
    is my specific machine name

    Of course not, you’d have to change it to point to the SQL Server CE database file. Probably the best way is to not hardcode it, but use a relative path to the database. It looks like this for instance:

    Data Source=|DataDirectory|\MyDb.sdf, where |DataDirectory| points to the App_Data folder of your application.

    Also plese see the error screen map i have attach with the question..

    Your error is quite clear – there was a problem establishing a connection to your database. It either doesn’t exist or isn’t accessible from your current machine.

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

Sidebar

Related Questions

Hai every one I am developing an windows application in which i have to
I am developing a Windows Form Application against a SQL Server relational database. An
I'm developing my first Windows Phone 7 application and I have to add an
I am developing an application which uses an xmlrpc service to communicate. I developed
I am developing a SharePoint application which needs users from a specified Windows Server
I am developing an application which have the following windows If the information entered
I've been developing my first rails application on my windows computer. But now i
I'm developing a Windows application in VS2005 using C#. In my project, I generate
I am developing a windows application in C#. I have been searching for the
I am developing a windows application using c#. I am loading a file (html,

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.