I'm trying to execute a query that currently works in phpMyAdmin but it does not working when executing it in .NET using the MySqlAdapter. This is the Sql statement.
SELECT @rownum := @rownum +1 rownum, t . *
SELECT @rownum :=0
) r, (
TYPE FROM `node`
WHERE TYPE NOT IN ('ad', 'chatroom')
using (var sqlConnection = new MySqlConnection(SOURCE_CONNECTION))
MySqlDataAdapter sqlAdapter = new MySqlDataAdapter(SqlStatement, sqlConnection);
DataTable table = new DataTable();
I found this blog, which tells, that with newer versions of .net Connector you have to add
;Allow User Variables=True
to the connection string. Compare my SO question How can I use a MySql User Defined Variable in a .NET MySqlCommand?