I Have a Query in mysql like this:
select
t1.id_invoice_in, t1.paymentcode, t1.personname, t1.amount,
t2.id_invoice_out, t2.paymentcode, t2.personname, t2.amount
from (
select
id_invoice_in, paymentcode, personname, amount,
(@r1 := @r1 + 1) as r1
from invoice_in
join paymenttype pt on pt.id = paymenttype_id
join persons p on p.id = person_id
,(select @r1 := 0) r
) t1 left join (
select
id_invoice_out, paymentcode, personname, amount,
(@r2 := @r2 + 1) as r2
from invoice_out
join paymenttype pt on pt.id = paymenttype_id
join persons p on p.id = person_id
,(select @r2 := 0) r
) t2 on t1.r1 = t2.r2;
That query working fine on phpmyadmin. When i put the query in VB.net like this:
myCMD = New MySqlCommand(strQuery, MysqlConn)
mysqlReader = myCMD.ExecuteReader()
i got the error: "fatal error encountered during command execution" from exception message.
i guess maybe the query containt this symbol '@', so i must write myCMD.Parameters.AddWithValue("@", something else). *correct me if im wrong.
the question is, how vb.net by pass the query without entry myCMD.Parameters.AddWithValue. So vb.net just running the query without must entry '@' value, because no value for '@'.