I have developed a c# windows application which uses SQL server 2012 database in Visual Studio 2015 which is running well on my pc. I am to install this application on a number of computers without SQL server installed on it, but when I run the application, its gives me database connection error. My question is, how can I create the setup file to be able to run the app on those clients pc without installing SQL server on all those computers. Please I need your help. Thank you. Am Emmanuel.
Asked
Active
Viewed 709 times
1 Answers
1
Use an Azure database and have the clients connect to that. Have a look at https://azure.microsoft.com/en-us/services/sql-database/ Alter your application connection string and make sure you keep the connection string secret.
Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin@myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;
An important fact is that the clients need to allow communication via port 1433.
If this is not an option create an API application and query the database via that.
If you need a private database per client you can use a database file and connect to the file
Update based on reply
You can create a pop-up on the application allowing the users to add valid settings and credentials when your appsettings.json is blank or "a test connect" to the database fails.
Walter Verhoeven
- 3,867
- 27
- 36
-
Thank you for the support, but I can't register for Azure right now so i would like to know there is a way to create the setup file using codes in Visual Studio. I will very happy if I can be assisted in this. – emma aboagye Mar 01 '21 at 15:09
-
@emmaaboagye, what do you mean by setup? The tool I like is https://stackoverflow.com/questions/19160779/innosetup-code-signing-certificate/48861756#48861756 – Walter Verhoeven Mar 02 '21 at 12:59
-
What I meant by "setup" is the creation of the ".exe installation file." – emma aboagye Mar 03 '21 at 11:23
-
have a look at https://www.youtube.com/watch?v=4t2TI8ImwMY – Walter Verhoeven Mar 04 '21 at 14:24
-
You are welcome, feel free to add an upvote if you like a question or answer in StackOverflow and mark the answer as "answered" if you are satisfied so that other users know that you are "good" for now and the question is answered. If you need a online database let me know and I hook you up with one so you can test, my homepage is asp-waf.com – Walter Verhoeven Mar 12 '21 at 07:12