Hi all,
I have a small fragment of code that is puzzling me… It works fine in C# .Net 2.0 In visual studio, but when using it in Unity, some strange problems occur.
This is the code I usually use to return a datatable from a database:
DataTable ret = new DataTable();
MySqlCommand cmd = new MySqlCommand(sql, connection);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
da.Fill(ret);
This is the error that I get in Unity:
The best overloaded method match for System.Data.Common.DataAdapter.Fill(System.Data.DataSet)' has some invalid arguments. Cannot convert System.Data.DataTable’ expression to type `System.Data.DataSet’
Also, when I use a dataset instead, I get the same error, just stating that dataset cannot be converted to dataset!!
What can I be doing wrong? What can I do to work around this?
Thanks in advance! ![]()