How to connect F # to MySQL database?

Hi I am a newbie using F # and MySQL. I have a project that should retrieve data from mySQL database. Far I installed wamp, mySQL, mySQL-connector, php. I do not know how to contribute F # and mySQL. Could you give me information on the steps.

Thank,

+5
source share
2 answers

You need a MySQL connector for .NET, this one, for example .

let connectionStr = "Data Source=localhost; Port=3306; User ID=root; Password=q1w2e3;"
let connection : IDbConnection = upcast new MySql.Data.MySqlClient.MySqlConnection(connectionStr)

See the System.Data documentation for more information .

Hope this will be helpful.

+5
source

F # works with regular .NET class libraries. This way any .NET MySQL connector will work.

, : http://dev.mysql.com/downloads/connector/net/

0

All Articles