I am running into one headache issue regarding data type conversion in linq select statement, please see it as below, I would like to convert the string type of one below field with hightlight to double type, so i leverage Convert.ToDouble method to do it, however, it failed . any help or suggestion is appreciated.
Thanks in advance.
var orders = (from q in dao.CurrentDBContext.Order
from d in dao.CurrentDBContext.OrderGoodsDetail
where q.billNum == d.billNum
select new
{
q.billNum,
q.orderSource,
q.sourceOddNum,
q.orderType,
q.createdTime,
q.physicalNum,
q.ShopName,
q.pay_time,
d.SpecificationCode,
d.SpecificationName,
d.Color,
d.Size,
d.CommodityCode,
d.SKU,
d.StandardSellingPrice,
d.pay_ment,
**StandardWeight= Convert.ToDouble(d.StandardWeight),** //the date type of d.StandardWeight is string , i would like to convert it to double type.
d.PurchaseNumber
});