Hi i've this kind of exception using Devart. I'm calling a store procedure in MySql. The Store procedure function if i call it by DB.
using (dc = conn.GetContext())
{
result = dc.StoreProcedure(pId).FirstOrDefault();
}
return result;
[MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(7003172) t1 LIMIT 1' at line 2]
Devart.Data.MySql.bk.s() +270
Devart.Data.MySql.bk.d() +200
Devart.Data.MySql.v.a(ah[]& A_0, Int32& A_1) +134
Devart.Data.MySql.v.a(Byte[] A_0, Int32 A_1, Boolean A_2) +106
Devart.Data.MySql.a3.e() +169
Devart.Data.MySql.a3.o() +89
Devart.Data.MySql.MySqlCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords) +1472
Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery) +48
Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery) +764
Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) +38
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +12
Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1, Object[] A_2, Object A_3) +1436
[LinqCommandExecutionException: Error on executing DbCommand.]
Devart.Data.Linq.LinqCommandExecutionException.a(String A_0, Exception A_1) +79
Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1, Object[] A_2, Object A_3) +5349
Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1) +65
Devart.Data.Linq.Provider.DataProvider.h(Expression A_0) +189
Devart.Data.L开发者_如何学Cinq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +53
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +269`
Apparently, the problem is that the procedure is marked as 'pipelined' in the model. In this case, it is supposed that the procedure has a return value which is a result set. Thus, the LinqConnect runtime tries to perform a select from this result set (ending with the 'limit 1' clause because of the 'FirstOrDefault' method).
Since MySql functions cannot retrieve result sets as return values, this behaviour leads to a MySQL error. To resolve the problem, please try setting the 'Pipelined' property of this procedure to 'false'.
精彩评论