The execution result of this function is incorrect:
Bytes ----------------------------------------------------------------------------------------------------------------------------
Public ilist <int> getamountoffastnesswindvalueinvillage (string value, string languagecode)
{
String SQL = "(select count (*), species from trees where standard serial number = @ descriagecodeand trunk fullness branches = @ bvalue group by species) Union (select 0, tree Species from trees where tree not in (select tree species from trees where standard region number = '000000' and trunk fullness branches = @ bvalue group by tree) order by tree ";
Ilist <int> amountoffastnesswindvaluevillage = new list <int> ();
Oledbparameter [] parms = new oledbparameter [] {
New oledbparameter (@ villagecodeand, oledbtype. varchar, 50 ),
New oledbparameter (@ bvalue, oledbtype. varchar, 50 )};
Parms [0]. value = value;
Parms [1]. value = languagecode;
Using (oledbdatareader RDR = olehelper. executereader (olehelper. connectionstring, commandtype. Text, SQL, parms ))
{
While (RDR. Read ())
{
Amountoffastnesswindvaluevillage. Add (RDR. getint32 (0 ));
}
}
Return amountoffastnesswindvaluevillage;
}
Bytes -----------------------------------------------------------------------------------------------------------------------------
Modify this function and the execution result is correct:
Bytes -----------------------------------------------------------------------------------------------------------------------------
Public ilist <int> getamountoffastnesswindvalueinvillage (string languagecode)
{
String SQL = "(select count (*), species from trees where standard serial number = @ villagecodeand trunk fullness branches = 'out' group by species) Union (select 0, tree from trees where tree not in (select tree from trees where standard region no. = @ villagecodeand and trunk fullness branches = 'you' group by tree) order by tree ";
Ilist <int> amountoffastnesswindvaluevillage = new list <int> ();
Oledbparameter parm = new oledbparameter (@ brief agecodeand, oledbtype. varchar, 50 );
Parms [1]. value = languagecode;
Using (oledbdatareader RDR = olehelper. executereader (olehelper. connectionstring, commandtype. Text, SQL, parm ))
{
While (RDR. Read ())
{
Amountoffastnesswindvaluevillage. Add (RDR. getint32 (0 ));
}
}
Return amountoffastnesswindvaluevillage;
}
Bytes -----------------------------------------------------------------------------------------------------------------------------
I don't know why.