开发者

Accessing stored procedure in Linq-to-SQL

I'm using Linq-to-SQL query and using stored procedure in that. I'm getting error :

Specified cast is not valid.

How开发者_开发百科 to solve it ?

Accessing stored procedure in Linq-to-SQL


Check your TDetail.AMOUNT values.

Your error is not when casting to an array, but rather in the Convert.ToDouble(TDetail.AMOUNT).

Run your stored proc with those same arguments (in SSMS or Visual Studio), and try to determine which value in TDetail.AMOUNT is causing this problem.

You're seeing this exception being thrown when you cast to an array, but it would happen whenever you evaluated your LINQ query. It's nothing to do with ToArray(). It could be ToList(), and you'd find the same exception.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜