opeliaa
opeliaa

Reputation: 105

how to connect F# to MySQL database?

Hello I am a newbie using F# and MySQL. I have a project that needs to retrive data from mySQL database.So far, i installed wamp, mySQL, mySQL connector, php. I don't know how to contribute F# and mySQL. Can you please give me a piece of information about the steps .

Thanks,

Upvotes: 6

Views: 3859

Answers (2)

khachik
khachik

Reputation: 28693

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 System.Data documentation for detailed information.

Hope this is helpful.

Upvotes: 7

tylerl
tylerl

Reputation: 30857

F# works with the normal .NET class libraries. So any .NET MySQL connector will work.

For example, this on here: http://dev.mysql.com/downloads/connector/net/

Upvotes: 0

Related Questions