I have just updated from MySql.Data.MySqlClient .Net Core Class Library version 8.0.21 to 8.0.22 and it seems to have caused errors for some of my SQL queries. I am not getting the following error:
"Non-negative number required. (Parameter 'count')"
When I am trying to run the following code:
DataTable dt = new DataTable();
try {
using (MySqlConnection con = new MySqlConnection(ConnectionString)) {
using (MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM shortcuts WHERE user = @id", con)) {
da.SelectCommand.Parameters.AddWithValue("@id", userId);
da.Fill(dt);
}
}
} catch (Exception ex) {
Console.WriteLine(ex.Message);
dt = null;
}
I cannot see what the error is complaining about and I only have 8 records in the "shortcuts" table that I am trying to retrieve data from. Since I haven't changed any of my code and it was working before I updated my NuGet package, I am assuming that it is an issue with the latest build. I did, however, try to downgrade back to the version I was on and there was no luck.
I don't know if this is the right place to report errors or get information but I would appreciate any help. Here are some things that I have tried:
Thanks for any assistance you can provide
Are you querying a table that has a CHAR(36)
column (i.e., a GUID) containing NULL
s? If so, you're encountering bug 101252, a regression introduced in MySql.Data 8.0.22.
You could roll back to 8.0.21, but I would personally recommend switching to MySqlConnector (disclaimer: I'm the lead contributor) as it has better compatibility with .NET Core and fixes many bugs present in MySql.Data.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加