Author Archives: Emre AYRILMAZ

t-sql with ties kullanımı

      Yorum yok t-sql with ties kullanımı

select top 5 ProductName,UnitPrice,UnitsInStock from Products where UnitsInStock > 10 order by UnitsInStock select ProductName,UnitPrice,UnitsInStock from Products where UnitsInStock > 10 order by UnitsInStock select top 5 with ties ProductName,UnitPrice,UnitsInStock from Products where UnitsInStock > 10 order by UnitsInStock

mvc webgrip ve excel export

      Yorum yok mvc webgrip ve excel export

[HttpPost] public ActionResult Export(string module) { SiteEntities db = new SiteEntities(); WebGrid grid = null; if(module == “Tercümeler”) grid = new WebGrid(db.Tercume,,columnNames:new []{“Id”, “Kod”, “Tr”, “En”}, canPage: false, canSort: false); else if (module == “Listeler”) grid = new WebGrid(db.Liste, canPage: false, canSort: false); else if (module == “Lokasyonlar”) grid =… Read more »

ExceptionHelper

      Yorum yok ExceptionHelper

public static class ExceptionHelper { public static string GetMessage(this Exception ex) { StringBuilder expS = new StringBuilder(); expS.Append(ex.Message); Exception inner = ex.InnerException; while (inner != null) { expS.AppendFormat(“{0}-{1}”, Environment.NewLine, inner.Message); inner = inner.InnerException; } return expS.ToString(); } }  

javascript image cycle

      Yorum yok javascript image cycle

<body> <img id=’img_’ src=’#’ width=’100′ height=’100′ /> <input type=’button’ name=’name’ value=’sonraki resim’ onclick=’next();’ /> <script> var index = -1; var pictures = new Array( ‘Images/0004574.jpg’, ‘Images/0004604.jpg’, ‘Images/0004611.jpg’, ‘Images/0004613.jpg’, ‘Images/0004592.jpg’); window.onload = function () { next(); } function next() { index = (index + 1) % pictures.length; document.getElementById(‘img_’).src = pictures[index]; console.log(index);… Read more »

LINQPad – group by ile pivot

      Yorum yok LINQPad – group by ile pivot

yakınen bildiğimiz t-sql groupby sorgu örneği select C.CategoryName,Count(EC.CategoryId) Adet from EntryCategories EC join Categories C on EC.CategpryID = C.Id group by C.CategoryName bunu linq ile uyarlayıp alıp biraz değiştirince çok da güzel pivot oluyor from p in db.EntryCategories where p.Entry.EntryTime.Year == 2010 group p by p.Category.CategoryName into g select new… Read more »