Connect to online MySQL database in C# desktop application

时间:2015-06-15 14:30:38

标签: c# mysql

I have a problem with connecting to the database.

private static readonly string s_connectionString = "Server=db.inu.hu; Database=patientRegistry;UID=****; Password=****; Port=3306; Trusted_Connection=true";

That's my connection string and with this I can't open the connection.

 using (SQLiteConnection conn = new SQLiteConnection(s_connectionString))
  {
      conn.Open();
  }

I thought the problem might be that I have a table in the database and need to add that to the connection string.

1 个答案:

答案 0 :(得分:1)

Are you trying to connect to MySQL or SQLite? You are referencing a SQLiteConnection object, but I think you need to be using a MySqlConnection connection object instead.

相关问题