首页 新闻 搜索 专区 学院

Error 2 Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missi

0
悬赏园豆:5 [已关闭问题] 关闭于 2015-09-23 13:50
EnumerableRowCollection<PlatformLogPO> source = 
                from log in dataTable.AsEnumerable()
                select new PlatformLogPO
                {
                    PlatformId = (log["platformId"] == DBNull.Value) ? 0L : ((long)log["platformId"]), 
                    RequestInfo = (log["requestInfo"] == DBNull.Value) ? string.Empty : ((string)log["requestInfo"]),
                    SalesType = (log["salestype"] == DBNull.Value) ? 0 : ((byte)log["salestype"])
                };

在最后

SalesType = (log["salestype"] == DBNull.Value) ? 0 : ((byte)log["salestype"]) 将String 转成Byte 时出了问题
Freedom0619的主页 Freedom0619 | 初学一级 | 园豆:10
提问于:2015-09-23 13:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册