Dhruva Hein

Dhruva Hein

  • NA
  • 6
  • 0

MySQL URL won't open in Visual Studio

May 26 2016 9:17 PM
I'm working on a Xamarin Android project in C# in Visual Studio Community 2015.
 
I'm trying to call a PHP script that will log into MySQL using WebClient. This is all on Windows 10 x64 running Apache 2.4, PHP7 and MySQL 5.7.
 
For some reason, Visual Studio won't connect to MySQL. I've tried localhost, COMPUTERNAME, the IP address of the emulator adapter. They will all connect on a command prompt.
 
My code is:
 
WebClient client = new WebClient();
Uri uri = new Uri("http://localhost/phpinfo.php");
client.UploadValuesAsync(uri, parameters);
 
(The uri and parameters are all correct. I've checked this.)
 
The connection isn't made when I run the code, but I can't even connect when I control-click the URL in the code window. Any ordinary URL from the web will load, but none of the addresses that should connect to MySQL.
 
I would imagine that there is some setting in Visual Studio that has an incorrect value, but i can't figure out where it might be.
 
I'd be grateful for any guidance/suggestions etc.

Answers (2)