score:0

Have you tried model-defined functions?

<Function Name="ConvertToDecimal" ReturnType="Edm.Decimal">
     <Parameter Name="myStr" Type="Edm.String" />
     <DefiningExpression>
          CAST(myStr AS Edm.Decimal(12, 2))
     </DefiningExpression>
 </Function>

Check this answer: Convert string to decimal in group join linq query

score:1

You have to get the data to a List<Order> first and after that you can cast whatever you want.

var orders = 
    from s in
        ((from o in db.Orders
        where o.Order_Complete
        select o).ToList())
    select new { 
        s.Order_Id, 
        s.MySEL_Name, 
        s.MySEL_EMail, 
        s.MySEL_Bus_Name,
        Double.Parse(s.Total_Amt),
        s.Order_Complete_DateTime
    };

I think the EMS way would look much better in your code ;)

var orders =
    db.Orders.Where(s => s.Order_Complete).ToList().Select(s => new { /*...*/ }

After casting ToList() you have got the data object based and can modify it, if you don't you can use Double.Parse because EF is trying to find e.g. a stored procedure on the database and will throw an exception.


Related Query