开发者

linq to datasets - get a specific datarow

i have a table with these columns: errorCode (int) errorDesc (Varchar)

i'm trying to get the datarow where errorCode is 5:

  DataRow resultCodeRow = (from resultCodesTableRow in resultCodesDT.AsEnumerable()
                                 where resultCodesTableR开发者_如何学JAVAow.Field<int>("result_Code_colum_Name") == 5
                                 select resultCodesTableRow).Single();

why do i get the error:

"Specified cast is not valid."

how would you write it ?


You need to change it to decimal

PK

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜