0

Let's say I have an .NET application installed on my computer that I developed in VB.NET and it uses a database and it feeds it with information. And now I have a webhost, let's say iPage(which is what I'm using atm), I put up my website there and I want to check the information I fed to the database.

I thought I could connect directly to MySQL server in webhost and feed it with my application, but it so happens that only websites hosted on the same server can connect to the MySQL database, I'm guessing this is for security reasons, so I tried making a form in my application that would submit information to the website and feed the database, without success, I couldn't figure out how, also didn't try that hard, since I've read many times that it's not possible to submit information x-browser, also for security reasons, anyway, I couldn't find a way to make this work and what I did was a pure website application, which works fine, but it's not what I wanted and still isn't what I want.

The question here is: how can I accomplish this? How can I feed a web hosted MySQL database with a .NET application so I can retrieve this information from any other computer with a browser and internet access.

1 Answer 1

1

You have read a lot of incorrect information.

but it so happens that only websites hosted on the same server can connect to the MySQL database

This isn't true at all. You can connect to whatever database you want over a network... such as the internet. If you have an application that needs to update information in a remote database, go for it.

Now, there are a couple things you should know about. First is that MySQL's wire protocol sends all of your data in the clear. You will want to use MySQL over a secure tunnel. An easy way to handle this is to set up a VPN between your servers and your application populating the data.

Another thing to note is that accessing a database over the internet is slow. Put your database close to the servers your users will be using. What is updating that database can be over the slower link.

Finally, your application would then need to know the connection information for your MySQL database. It isn't clear from your question whether or not this is some sort of administrative application that you will be using, or something you will distribute to your users. If you're sending this to your users, you definitely don't want to give them your MySQL credentials, open your database to the whole world, and require your users to have MySQL client libraries installed. Instead, consider making some simple RESTful APIs that your application uses to communicate.

I tried making a form in my application that would submit information to the website and feed the database, without success, I couldn't figure out how, also didn't try that hard, since I've read many times that it's not possible to submit information x-browser

This is a winforms .NET application right? Cross browser doesn't mean anything outside of a web context. If you're loading up a web browser control and loading a page on your site for this form, then it's no different than if you were to go to that page with a regular web browser. There are no cross origin issues. Rather than simply giving up when you run into problems and assuming what the reason for them is, figure out what the specific problem is. Ask specific questions here on Stack Overflow. You'll accomplish much more.

The question here is: how can I accomplish this?

  • If you control your application's usage, connect to MySQL directly.

  • If you need to distribute this application, consider building RESTful web services your application connects to.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.