public string Data()
{
string dohvat_podatka = "";
using ( MySqlConnection con = new MySqlConnection("Server=xxx.000webhost.com;Port=3306;Database=xxx;Uid=xxx;password=xxx;"))
{
con.Open();
using (MySqlCommand cmd = new MySqlCommand("SELECT ime FROM `nastavnik` WHERE prezime=@prezime", con))
{
cmd.Parameters.Add(new MySqlParameter("prezime", "Carić"));
using (MySqlDataReader dr = cmd.ExecuteReader())
{
if (dr.HasRows)
{
while (dr.Read())
{
dohvat_podatka = dr.GetString(0);
}
}
}
}
}
return dohvat_podatka;
}
So what I m trying to do is to connect from my asp.net FREE HOST to a MySql FREE HOST. Is this connection possible? Of course I m getting a error due to the specified connection. I think that the problem is the free hosting that does not allow such a connection to their servers, what' s your opinion?
By the way I m having huge problems with mssql so i can't host on somee.com which would be the best way, but It would me take me like a week to do that.