Fatal error encountered during command execution while executing Mysql query
-
Hi i have created one web application and in that i need to read the data from Mysql database and bind to gridview. I have written Mysql query as follows SELECT @row_number:=@row_number+1 AS row_number,Name FROM tablename, (SELECT @row_number:=0) AS r After running in Mysql in database it will and work show the result. But if take same query and execute through C# code below error is coming. An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll but was not handled in user code Additional information: Fatal error encountered during command execution. and i will get Break or continue pop up. If i give continue it will show Parameter '@row_number' must be defined. even i defined like int @row_number = 0; but same error. I need to achieve serial number as shown below ex in database slno name 10102 nama1 2123 name2 5203 name3 result 1 nama1 2 name2 3 name3 how to achieve this. If anybody knows please reply me. Thanks in advance.