Skip to content

MySQL connection C# library

Hello all,

Is it possible to use mysql.data package in c# in a PLCNext library. The newest versions require higher framework, but I am able to install MySql.Data Nuget Package version 6.9.12 in my project, since the package has no dependencies. But then I am not able to add "using Mysql.Data". Is this due to the PlcNext CLI? Is it somehow possible to use it? Or maybe in C++ then?

I am using the DBFL_SQL_5 right now in a .st file in plcnext engineer, but the handling of data is a bit complex since all data should be converted into strings before writing, and the buffer is too small to read a full row of data. So I am reading out the row per column right now, which cost around fourty cycles to get all data... Maybe I am missing some ways to simplify it with the function blocks, but now it's a bit messy with al the CONCATs, TO_STRINGs and multiple different read commands + write to one db, and a write to a different one.

So should I just take the 'messy' ST solution, or is it quite easy to use C# (or C++)?

Arne

Comments

  • I had to add the reference once more by hand, since it was not in the list of selectables, but now I am able to use it. will try to implement it now.

  • Seems like system.data is necessary, but that will retarget the project from eclr 3.3 to .net framework 4...

  • Same problem… Did you find any solutions?

Sign In or Register to comment.