Monday, March 14, 2016

Max id find by LINQ



Int64 billserial = Convert.ToInt64((from n in db.BillDbSet
                                                    where n.COMPID == model.COMPID &&
n.BILLNO == model.BILLNO && n.BILLYY == model.BILLYY
                                                    select n.BILLSL).Max());

if(billserial==0)
{
.......................
}
else
{
.....................
}

No comments:

Post a Comment