I am writing a program in C # .NET I would like to collect the full frequency of the class (let each class have many words, and each word has its own frequency in the corresponding class)
So, I used the sum () function in mysql. But there is a mistake saying that my cast is wrong.
public void average_each_type() { MySqlDataReader result; int total_freq = 0; string type = ""; command.CommandText = "select class_name ,SUM(frequency) as sum_of_freq from training_set group by class_name "; result = command.ExecuteReader(); while (result.Read()) { total_freq = (int)result["sum_of_freq"];
source share