Wednesday, August 16, 2017

Like not vulnerable to injection

create table #test (name varchar(100))   
insert into #test values ('fgdgfdfg'),('cxvxbcvb'),('tryuryry')
declare @like varchar(100) = 'f; select * from #test --'
select * from #test where name like @like + '%'

drop table #test

Friday, June 30, 2017

Tuesday, June 13, 2017

simple example of async saving time

    static async Task<string>  blah()
        {
            await Task.Delay(5000);
            return "blah " + DateTime.Now.ToString();  
        }

        static async Task<string> masterblah()
        {
            Task<string> a =  blah();
            Task<string> b =  blah();
            Task<string> c =  blah();

            string a1 = await a;
            string b1 = await b;
            string c1 = await c;
            Console.WriteLine( string.Format("{0}-{1}-{2}", a1, b1, c1));
            return string.Format("{0}-{1}-{2}", a1, b1, c1); 
        }
       
        static void Main(string[] args)
        {

            Console.WriteLine(DateTime.Now);

            masterblah();

Thursday, June 8, 2017

Lync not starting

I killed the process (communicator.exe) and removed the cache