开发者

how to connect F# to MySQL database?

开发者 https://www.devze.com 2023-02-08 09:33 出处:网络
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 开发者_StackOverflow中文版wamp, mySQL, mySQL connector, php.

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 开发者_StackOverflow中文版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,


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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消