0

I have created a Windows Forms desktop application using Visual Studio 2019. I also created a database using SQL Server Management Studio. I connected the database with my application with connection string

"Data Source=CYBERCELL\\SQLEXPRESS;Initial Catalog=Details;Integrated Security=True;"

The application is running without any error. I published this application using Visual Studio 2019 publish wizard and installed in another computer. But I can't understand how to use and connect the database with the application in that system.

I am looking to install SQL Server in every computer. But if I install SQL Server, the server name will be different.

3
  • If you're locally installing SQL Server Express on each individual computer, you could use .\SQLEXPRESS (or (local)\SQLEXPRESS) as your server/instance name - this is the same on every computer Commented Jan 8, 2022 at 7:47
  • 1
    You've asked this before. The previous question has open queries in the comments from people who were willing to help. Next time, instead of asking the same question again, engage with people asking you questions s; they aren't asking to be annoying, they're asking because you didn't put enough info in the question first time to enable it to be answered Commented Jan 8, 2022 at 8:52
  • 1
    Does this answer your question? C# Windows Form Application With SQL Server database deployment Do not repost the same question again, it annoys everyone and is severely frowned on. Instead improve your original question by answering basic information requested in the comments Commented Jan 8, 2022 at 20:53

2 Answers 2

0

If you're locally installing SQL Server Express on each individual computer, you could use

.\SQLEXPRESS

or

(local)\SQLEXPRESS

as your server/instance name - this is the same on every computer. The dot . or (local) (in parenthesis) refers to the local computer, and SQLEXPRESS is the default instance name for any SQL Server Express installation.

Sign up to request clarification or add additional context in comments.

Comments

0

I once stuck with this same scenario... and this is how I solved the problem,

You don't have to install SSMS or SQL server on any of your client's pc, if you follow these steps

  1. You have to create a localDB on your application and make sure the application will connect to that localDB.(if you don't know how to connect to local db, here => Connect to LocalDB. And make sure to create tables and procedures as same as your previous database.

  2. Follow this answer(ticked) with code(connection string)

  3. After this, you have to install Advanced Installer to create an installer for your application (the best choice I ever chose).

  4. Then Follow this to create an installer where you make sure to add a prerequisite of localDB (say localdb 2019) installer of your current version.

  5. This makes your application run on any pc and only requires localdb as a prerequisite to be installed which also comes with the installer.

  6. Make sure to leave a message not to delete localdb on the application installed location.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.