I know that there are a lot of questions regarding this topic, however after four days of reading and googling, I am kind of stuck and need somebody to clarify some things for me please.
My situation:
I have developed a WPF application in C#. This application needs to be connected to a database, as it stores useraccount data and others. Up to now, I have worked with a local database in the Visual Studio Environment by setting up a datasource and using Fluent NHibernate for mapping and session. Now I would like to distribute the application to users via ClickOnce, so I need to switch from local to online database.
I have a Webserver (Debian 8 Jessie 64Bit, Kernel Version 3.16.0-4-amd64 (SMP)), SSH access and access to the i-MSCP 1.3.16 platform for administrating the server. I created a database in one of the server's domains and a sql-user and I can access phpmyadmin.
I have followed to steps to grant remote access for any IP, as described for example here by SANDHYALAL KUMAR.
First question: How can I check whether remote access is now successfully granted. Because when executing mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
I get 0 rows affected.
by the Putty console?
Second and more important question: How can I connect my WPF now with my server. I have read, that I should not directly connect to the server, because of password security and database security, like this:
ISessionFactory sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2012
.ConnectionString(c => c
.Server("SSS")
.Database("DDD")
.Username("UUU")
.Password("PPP")
).ShowSql()
)
.Mappings(m =>
m.FluentMappings
.AddFromAssemblyOf<User>())
.ExposeConfiguration(cfg => new SchemaExport(cfg)
.Create(false, false))
.BuildSessionFactory();
return sessionFactory.OpenSession();
However, I do not think that above solution would work for me, as I do not have an online MSSQL Server, right? Or do I need to configure my existing server?
Is there a specific layer or API which solves my problem. Is either WCF or REST or ADO.Net a solution for me? I'm really stuck with all these different names, so I would be truly thankful for some explanations and advice regarding my two questions.