locked
MySql connection RRS feed

  • Question

  • Hello!

    I'm using a MySql connection to fetch data from my database. On my localhost, it is able to fetch the data, but i can't connect to others databases. I don't understand why. Here's my piece of code.
    string MyConString = "SERVER=localhost;DATABASE=BIM;UID=root;PASSWORD="
     
    MySqlConnection connection = new MySqlConnection(MyConString); 
    try 
        connection.Open(); 
    catch 
        errorMsg("Couldn't establish SQL-connection!"); 
    MySqlCommand command = connection.CreateCommand(); 
    MySqlDataReader Reader; 
    command.CommandText = "SELECT * FROM matches WHERE id="+textBox1.Text; 

    What the hell am i doing wrong? Btw, I get
    Couldn't establish SQL-connection!");
    when i do this.
    Friday, October 31, 2008 4:37 PM

Answers

All replies