Thursday, February 26, 2015

debugging a windows service

follow this pattern in program file

#if DEBUG
            MethodInfo mi = qCenterService.GetType().GetMethod("OnStart", BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic);
            mi.Invoke(BlahService, new object[] { new string[0] });
            Console.ReadLine();
#else
                     ServiceBase.Run(new ServiceBase[] { BlahService });

#endif

Monday, February 16, 2015

recent things done to an important and complex sql query to improve performance


  1. changed cross- apply to cte's
  2. added indices that had all the output columns needed instead of using clustered index which forced more reads
  3. removed max varchar columns from initial query to avoid key lookups and retrieved them at end of sql

Sunday, February 1, 2015

asp.net: Invalid postback or callback argument

<%@ Page EnableEventValidation="false" %>

CORS in asp.net

<httpProtocol>
        <customHeaders>
            <add name="Access-Control-Allow-Origin" value="*" />
            <add name="Access-Control-Allow-Methods" value="GET,POST,OPTIONS" />
            <add name="Access-Control-Allow-Headers" value="Content-Type, soapaction" />
        </customHeaders>
    </httpProtocol>