Monday, August 25, 2014

How to get sql query from LINQ?

Before getting linq data, using ToString method. Will see the generated SQL.
It is not easy to read and understand.

   var soldOutProducts = 
            from p in products 
            where p.UnitsInStock == 0;

   string sql =  soldOutProducts.ToString();

Wednesday, August 13, 2014

Scheduled Tasks In ASP.NET With/Without Quartz.Net

With:
http://www.mikesdotnetting.com/Article/254/Scheduled-Tasks-In-ASP.NET-With-Quartz.Net

Without:
        protected void Application_Start()
        {
            System.Timers.Timer myTimer = new System.Timers.Timer(10 * 60 * 1000);
            myTimer.Elapsed += new System.Timers.ElapsedEventHandler(ScheduledTaskMethod);
            myTimer.AutoReset = true;
            myTimer.Enabled = true;
 }