开发者

linq to datasets - get a specific datarow

开发者 https://www.devze.com 2023-01-19 21:49 出处:网络
i have a table with these columns: errorCode (int) errorDesc (Varchar) i\'m trying to get the datarow where errorCode is 5:

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

精彩评论

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