Friday, September 15, 2017
select large image in paint
use the scroll
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
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
using like in dynamic sql parameters
add the '%' top the parameter value
set @p_SUBJECT = '%' + @p_SUBJECT + '%'
set @p_SUBJECT = '%' + @p_SUBJECT + '%'
Tuesday, June 20, 2017
handle hierarchical routes in Web API
Thursday, June 15, 2017
difference between maphttproute and maproute
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();
Subscribe to:
Comments (Atom)