I need to read some record from MYSQL table.
In a codeunit I have this code:
MySqlConnection := MySqlConnection.MySqlConnection;
MySqlCommand := MySqlCommand.MySqlCommand;
MySqlConnection.ConnectionString('server=localhost;uid=root;pwd=lufra9702;DATABASE=sys');
MySqlConnection.Open;
MySqlCommand.Connection := MySqlConnection;
MySqlCommand.CommandText := 'SELECT * FROM Table';
MySqlCommand.ExecuteReader;
When I try to execute it shows an error (see attached image).
Cannot serialize an instance of the following .NET framework object: assembly MySqlData, Version=6.9.8.0, Culture =neutral, PublicKeyToken.....
Where is the problem?
error triggered when trying to execute this statement:
MySqlCommand.Connection := MySqlConnection;
0
Comments
By the way, now the whole internet knows your root password