Re: 'Keyword not supported error' Using Dot Connect and MySQL.
Posted by: JOSE RAMIREZ
Date: September 19, 2017 11:33AM

Hello Anthony,

You mention that you were trying to connect to a MySQL database, however your code is making use of the classes that allow connections to a Microsoft SQL database. Mentioned classes don't support the "host" keyword, hence the error.

To connect to a MySQL database you'll need to either install MySQL Connector .NET or add the MySQL.Data Nuget package to your project. Once installed, just make the following small changes to your code:

using System.Data.SqlClient; -> using MySql.Data.MySqlClient;
SqlConnection -> MySqlConnection
SqlCommand -> MySqlCommand



Regards.

====================================
Jose Maria Ramirez

Options: ReplyQuote


Subject
Written By
Posted
Re: 'Keyword not supported error' Using Dot Connect and MySQL.
September 19, 2017 11:33AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.