Watch this example on YouTube:
Replace
public ActionResult TestPage(TESTEntities model = null)
{
var test = (from z in model.Customers2
select z);
if (!String.IsNullOrEmpty(model.Customers2.First().CustomerFirstName))
{
test = model.Customers2.Where(s => s.CustomerFirstName != null) &&
(s => s.FirstOrDefault().ToString().Trim().Equals(model.Customers2.FirstOrDefault().CustomerFirstName.Trim()));
}
return View();
}
With
public ActionResult TestPage(TESTEntities model = null)
{
var test = (from z in model.Customers2
select z);
if (!String.IsNullOrEmpty(model.Customers2.First().CustomerFirstName))
{
//test = model.Customers2.Where(s => s.CustomerFirstName != null) &&
// (s => s.FirstOrDefault().ToString().Trim().Equals(model.Customers2.FirstOrDefault().CustomerFirstName.Trim()));
test = model.Customers2.Where(s => s.CustomerFirstName == null ? false : s.CustomerFirstName.Equals("AAA"));
}
return View();
}
Thursday, 23 June 2016
Monday, 20 June 2016
MSSQL - Update Date Only - Keep orgial time
Watch this example on YouTube
Update TestTable Set
OrderDate = DateAdd(day, DateDiff(day, OrderDate, '1/1/2016'), OrderDate)
Update TestTable Set
OrderDate = DateAdd(day, DateDiff(day, OrderDate, '1/1/2016'), OrderDate)
Subscribe to:
Posts (Atom)