I set up a MySQL database in my AZURE account, but I cannot connect it in any way. I tried:
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
SqlConnection sqlconnection = new SqlConnection("Database=Banco1; Data Source=br-cdbr-azure-south-a.cloudapp.net;User Id=USERID Password=PASSWORDid");
Console.WriteLine("1");
sqlconnection.Open();
Console.WriteLine("2");
SqlCommand cmd = new SqlCommand("CREATE TABLE Customer(First_Name char(50), Last_Name char(50), Address char(50), City char(50), Country char(25), Birth_Date datetime); ", sqlconnection);
Console.WriteLine("3");
cmd.ExecuteNonQuery();
Console.WriteLine("4");
Console.ReadLine();
}
}
}
I tried putting prints through the commands, and the program only prints "1" which means I can't get the connection opened... how can I fix that?
The output error:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
Additional information: Error in the network or specifics to the instance when stablishing connection to the SQL Server. The server was not found or was not available. Check if the instance name is correct and if the SQL Server is configured to allow remote connection. (provider: Named Pipes Provider, error: 40 - Could not stablish connection to SQL Server)
