Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access SQL Server database in WPF via passing database name

I am using Ado.Net Connectivity Framework in my WPF application.

There is kind of a form in my MainWindow.xaml file. This form has two fields one is asking for database name and second is for PC Name.

Questions:

  1. I want to pass these values to App.config File in my WPF application. How to pass these values?

  2. Secondly I have to make my database centralized and my application launched from different computers have to access this centralized database?

  3. The way I am making this to access centralized database via these above defined fields is right way or is this is not a way to achieve required goal?

enter image description here

like image 773
Tameen Malik Avatar asked Oct 22 '22 00:10

Tameen Malik


1 Answers

We found an answer based on a good sized chat discussion.

His solution will probably require 1 of 2 things.

  1. Host a WCF service that performs CRUD operations on his database.
  2. Use a service like No IP to create a public location to his local machine, open ports for his database, and run the application with a direct connection. (he is aware of the limitations/security problems this creates)
like image 120
crthompson Avatar answered Oct 31 '22 22:10

crthompson