How to connect to a WAMP server database (located in default MySQL database location in WAMP) using C# 2010?

I tried...

SqlConnection conn = new SqlConnection("Data Source = C:\\wamp\\bin\\mysql5.1.36\\data\\testdatabase; User ID=; Password=;");

SqlDataAdapter da = new SqlDataAdapter("SELECT * from transactions", conn);

DataSet ds = new DataSet();

da.Fill(ds, "Transactions");

DataGridView1.DataSource = ds;
DataGridView1.DataMember = "Transactions";

SqlConnection is for connection to SQL Server, not MySQL. Either use OleDB, ODBC, or Connector/Net

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.