C# Use/connect to MySQL database in webhost (One.com)

I want to connect to my one.com webhost, by using my C# winforms application. The support said extern connections is NOT allowed, then how am I gonna read the database table on my webhost? I was told that if I used PHP on the website, then it would work, and it does. But how should i access that code from my program and make it return some values?

Any help will be appreciated. thanks in advance.

PS. If i'm unclear somewhere, or if you need more information then just explain what's needed.


Your webhost has probably restricted the access to your database so that only a specific host can connect to it, namely the one hosting your PHP based website. This is a common practice.

If this is the case, you cannot connect from any other host - and thus, your C# winforms app won't be able to connect either.

So a direct connection from your C# app to your database isn't an option, but you might implement a REST interface with PHP that serves the data you need to the outside world. This could then be accessed by the clients using your C# app. This is the only solution I can think of.

链接地址: http://www.djcxy.com/p/46192.html

上一篇: 如何从MySQL的PHP​​到Android的数据

下一篇: C#使用/连接到webhost(One.com)中的MySQL数据库