hi...
I have a problem with MySqlCommand class. Inside my query I use variables to emulate row_number inside groups, so i dont need to assign them in Visual Studio.
But I recieve a runtime error: Parameter '@num' must be defined. As i can understand MySqlCommand tries to find parameter values for all instances that start with @
Is there any possibilty to disable this functionality?
the source look like this:
string Query = @"
set @num = 0;
set @source = '';
select
@num := case when @source = x.Source then @num + 1 else 1 end as row_number,
@source := x.Source as dummy,
x.*
from
(
SELECT I.*
FROM Item I
ORDER BY I.Source
) x
";
using (MySqlCommand cmd = new MySqlCommand(Query, this.MysqlConnection)){
using(MySqlDataReader reader = cmd.ExecuteReader()){
}
}
thanks a lot
I have a problem with MySqlCommand class. Inside my query I use variables to emulate row_number inside groups, so i dont need to assign them in Visual Studio.
But I recieve a runtime error: Parameter '@num' must be defined. As i can understand MySqlCommand tries to find parameter values for all instances that start with @
Is there any possibilty to disable this functionality?
the source look like this:
string Query = @"
set @num = 0;
set @source = '';
select
@num := case when @source = x.Source then @num + 1 else 1 end as row_number,
@source := x.Source as dummy,
x.*
from
(
SELECT I.*
FROM Item I
ORDER BY I.Source
) x
";
using (MySqlCommand cmd = new MySqlCommand(Query, this.MysqlConnection)){
using(MySqlDataReader reader = cmd.ExecuteReader()){
}
}
thanks a lot