Friday, November 10, 2017

example to delay change in status bar

  //only bother setting OK if it isnt set yet
               _textbox.Dispatcher.BeginInvoke((Action)(() =>
               {
                   if (!_textbox.Content.ToString().Equals("System Messages:OK"))
                   {
                            //seperate thread for OK message with delay
                            var t = Task.Run(async delegate
                            {
                                await Task.Delay(TIME_TO_WAIT_TO_CHANGE_MSG_TO_OK_IN_MS);
                                DisplayData(DisplayMessageType.Normal, "OK");
                            });
                        }
                    }
                  ));

schema issues

someone hardcoded in an old program the wrong schema in an update statement

I went ahead and creates a matching schema and put the tables in a s views (select * )


Friday, September 15, 2017

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