wpf - best practise for connecting to a database server in c# -
i have been doing research , wondering best approach is, imagine scenario have wpf application being distributed many users, application has connect database server. connecting database not problem how secure connection external users have access application.
within app.config file connection strings can pointed server, releasing password , server ip address not idea. research, other people recommended encrypting data, sure still got degree of vulnerability.
the next approach use wcf, have limited knowledge on , not sure if approach correct.
am safe in encrypting connection strings or there more that, want careful when dealing sensitive data.
a common way add server layer between wpf app , database. can rest api or other web services like. in terms of technologies can choose, wcf one. wcf not easy started if not have experience of dealing services. suggest try asp.net's web api project establish rest service (http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1 ).
this server layer protect database information (connection string etc). also, allowing application directly querying database potentially prevent database evolving -- example, insert query may break on client side when add constraint on table. having server in between can solve future headache can update server side implementation , database simultaneously.
Comments
Post a Comment