Creating a client server app using c# that allows user to configure the server to which the app can connect -


i degree student , working on final year project. it's app connects remote server in order manage sql database created on server.

i have completed functionality app except part connects database\server. want user able specify, in setting menu of app, ip address of server want connect. , login database using login credentials.

i have searched on keep seeing videos developer connects database through visual studio want user of app have control specifying server want connect since machine hosting database may change in future.

please need guidelines on how go this. using c# , wpf project. thanks

if using sqlserver, can use sqlconnectionstringbuilder class in system.data.sqlclient generate connection string based on login credentials , server user input.

var builder = new sqlconnectionstringbuilder(); builder.datasource = <your server address>; builder.userid = <id>; builder.password = <password>; builder.initalcatalog= <inital db query>; 

you can use var connnection = new sqlconnection(builder.connectionstring) create connection , query database.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -