5 Ocak 2011 Çarşamba

Sql group by örneği

Örnek data

1 AUrun 10 AFirma
2 AUrun 11 BFirma
3 AUrun 12 CFirma
4 BUrun 9 AFirma
5 BUrun 8 CFirma
6 CUrun 15 BFirma
7 CUrun 14 CFirma
8 DUrun 18 AFirma
NULL NULL NULL NULL



select
Urun
, [1] = max(case when RowID = 1 then Firma +' ('+Cast(Teklif as nvarchar)+') ' end)
, [2] = max(case when RowID = 2 then Firma +' ('+Cast(Teklif as nvarchar)+') ' end)
, [3] = max(case when RowID = 3 then Firma +' ('+Cast(Teklif as nvarchar)+') ' end)
, [4] = max(case when RowID = 4 then Firma +' ('+Cast(Teklif as nvarchar)+') ' end)
from (
select
Urun
, Firma
, Teklif
, RowID = row_number() over (partition by Urun order by Teklif desc)
from [YKMTravelPortal].[dbo].[tempTablo]
) SourceTable

group by
Urun

===================

14 Nisan 2010 Çarşamba

Muhammedi Genclik

Hayırlı işlerin hepsine Bismillah

Şerlerin hepsine Euzû billah

Her korkuda Lâ ilahe illallah...

Her hüzün ve kederde Maşaallah

Her günaha Estağfirullah

Her musibette İnna lillah

Her nimette Elhamdûlillah

Her bolluğa Eş-şükrü lillah

Her şaşılacak şey için Sübhanallah

Her darlık için Hasbiyallah

Her kaza ve kadere Tevekkeltü al-A...llah...

Her itaat ve isyanda Lâ havle vela kuvvete illa billah

deriz.

13 Nisan 2010 Salı

Postsharp 1.5 vs 2010 integration


http://www.besystems.hu/blog/post/Using-PostSharp-with-Visual-Studio-2010-Beta.aspx


 


There is a possible memory leak in PostSharp execution and the "PostSharUseCommandLine=True" forces PostSharp to use command-line utility. "A new process will be created for each invocation, so there can be surely be no memory leak in this time."


The second was that the PostSharp compiler does not work with .NET 4 assemblies at this moment (PostSharp 1.5). So you will downgrade your PostSharp enabled projects .NET version to 3.5. :(


 


The modified C# project file:








  1. <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  

  2.   <PropertyGroup>  

  3.     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>  

  4.     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>  

  5.     <ProductVersion>10.0.20506</ProductVersion>  

  6.     <SchemaVersion>2.0</SchemaVersion>  

  7.     <ProjectGuid>{AE544EFB-2842-4A41-BF6C-3038D2046E90}</ProjectGuid>  

  8.     <OutputType>Library</OutputType>  

  9.     <AppDesignerFolder>Properties</AppDesignerFolder>  

  10.     <RootNamespace>Bes.Core</RootNamespace>  

  11.     <AssemblyName>Bes.Core</AssemblyName>  

  12.     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>  

  13. ...  

  14.   <PropertyGroup>  

  15.     <PostSharpUseCommandLine>True</PostSharpUseCommandLine>  

  16.     <DontImportPostSharp>True</DontImportPostSharp>  

  17.     <PostSharpDirectory>..\..\libs\PostSharp</PostSharpDirectory>  

  18.   </PropertyGroup>  

  19.   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />  

  20.   <Import Project="$(PostSharpDirectory)\PostSharp-1.5.targets" />  

Sharepoint 2010 Windows Form Application Reference

Sharepoint 2010 için oluşturulan Windows Form Application'lara Sharepoint dll'i referans verildiğinde uygulama compile ettiğinde referansı görmüyo ise dikkat edilecek noktalar;

 

1- Windows Form uygulamasının X86 olmaması

2- Windows Form uygulamasının Framework 3.5 olması önemlidir

Sharepoint 2010 Code Behind Assembly

Sharepoint'te custom oluşturulan sayfa yada user controllerin code behind dosyaları aynı projede olabileceği gibi farklı bir dll 'den de gelebilir.

Page'in aspx'inde yada user control'ün ascx'inde code behind tanımlası yapılırken

CodeBehind="XXX.aspx.cs" Inherits="XX Kod Dosyası" tanımlamasında XX Kod Dosyası


1- aynı projede ise aspx yada ascx'in en üst satırına


<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>


tanımlaması yapmak yeterli olacaktır.


2- farklı class lib de ise


   1. Create the Code-Behind Assembly
   2. Deploy the Code-Behind Assembly
   3. Reference the Assembly in your SharePoint Page
   4. Tell SharePoint that it is safe to use the assembly


(Kaynak: http://johanolivier.blogspot.com/2010/01/sharepoint-code-behind-tutorial.html)


 

5 Aralık 2009 Cumartesi

Why Software Development Projects Fail

Merhaba; online bir filmi izliyorum (Stag Night 2009), divx formatında olduğundan geç yükleniyo :) ben de aradaki boş vakti değerlendirmek için gündüz kurduğum, Microsoft eğitimlerinden biri olan Course 6368A: Programming with Microsoft® .NET Framework using Microsoft® Visual Studio® 2008 eğitimine göz atıyodum. Daha ilk sayfalarad hoşuma giden bi kısmı paylaşmak istedim. İngilizce döküman olduğu gibi aktarıyorum (Nede olsa google translate benden iyi çeviriyo).


Almost 75% of all software IT projects fail. A large proportion of these are obviously software development projects. So why does this happen?

Software development is abstract:
In contrast to constructing a house or skyscraper where one can see the progress, software development is to a large degree abstract and invisible. The end product cannot be seen until later in the project, and even then, the user interface is in actual fact a façade, hiding the true functionality.

Software development is complex:
While the composition of a software program is complicated (i.e. a system of many simple parts, but given enough time, may be ultimately understood) software development is actually complex, meaning that that its function cannot easily be understood because of interdependent relationships and outside influences changing the way it functions. In software development this is the case, as software developers are humans, they vary in terms of ability, intelligence, emotions etc. The system being developed is usually based on solving a real world (business) problem. This problem may not be completely understood to start with, and in the real world, probably changes over a period of time due to outside influences in any case. Therefore developing a software program to solve it, would be considered as a complex endeavor.

No development process:
Many projects are driven on an ad-hoc basis with no formal process. This may be because the initial project is not considered large or complex enough to warrant it, or the development team has an impromptu attitude. In either case, the lack of a development process is a serious oversight.

Incorrect or inadequate requirements gathering:
Probably the most important step in designing a software project is the gathering of the user’s requirements. If one gets this wrong, the chance of developing the correct products is infinitesimal. Ironically the chances of getting all the requirements perfectly correct is also very small due to a large number of reasons:
The complexity of the real world problem.
The person providing the requirements to the development team may not fully understand the problem either.
Corporate or internal politics in a company sometimes clouds the understanding of the problem.
Time constraints.
Communication noise. This is the disparity caused when people communicate with each other and is caused by differences between the person talking and the person listening like educational, background, experience etc. In other words the person listening does, not here exactly what the person is saying. In this case the situation is made worse by the fact that the person relaying the problem often has a business background, and the person listening to the problem has an IT background.

Unrealistic time schedules:
Too much work in too little time. This is often caused by other external time constraints such as ’we must go live in the next quarter’ to underestimation of the required time due to many of the points discussed in this topic.

Unknown or immature technology:
Often cutting edge projects use the newest technology around. This introduces another level of complexity due to unknown bugs, a technology that may not be tried and tested and may not be well known amongst the development team.

Incorrect or inadequate staffing:

Software development teams are constantly changing due to members leaving, working on other projects, on vacation etc. Additionally a technology may be chosen that is not the core competency of that development team. Regardless of the reasons, it often happens that the development team may not be at its optimal level when the project is under way.
In closing, these points highlight that software development is not a trivial exercise, almost regardless of the scope. This should not be used as an excuse for allowing projects to fail, but should rather be seen as a motivation to follow a structured, stable and well supported software development project, and to always be cautious with regards to the reasons for failure.

28 Kasım 2009 Cumartesi

Using Code Generation Templates with the Entity Framework 4.0

Sneak Peek – Using Code Generation Templates with the Entity Framework 4.0

Entity framework 4.0'ın en önemli yeniliklerinden biri olan POCO entity desteği. Özellikle EF 3.5 ile oluşturulan Entity Model ve onunla oluşan entityler, servislerde serialization problemlerine neden olmaktaydı ki nedeni entity objesinin üzerinde EF'ye ait relation gibi attribute'ların olmasıydı. İşte tam bu noktada EF 4.0 imdada yetişiyor. Ancak EF 4.0 ile POCO Entity leri oluşturmak için manuel bi kaç değişiklik gerekiyo ve Entitylerin oluşması için de T4 template generator'ın kullanılması gerek. Neyse ki bu vs 2010 template'lerinde var ve Edmx Designer'dan çağrılabiliyo. Detaylı bilgi için orjinal döküman linki aşağıdadır.


Published 19 May 09 01:42 PM | dpblogs

In the first version of the Entity Framework code generation was implemented internally using CodeDom. The Entity Framework APIs provided some hooks for customizing the generation, but customizing was tricky, relatively inflexible and wasn’t integrated into Visual Studio.

In .NET 4.0 all these limitations go away.

The Entity Framework now leverages T4, Text Template Transformation Toolkit, which makes customizing Code Generation easy, flexible and powerful, and the experience is also fully integrated into Visual Studio.

T4 itself is very simple, in fact you can try it out in Visual Studio 2008 today if you want. T4 provides a clean way of interleaving control logic and references to variables with output text, that is reminiscent of the techniques used widely in web server programming (for those familiar with old-school ASP or ASP.NET MVC views it will look vaguely familiar).

Out of the box the Entity Framework will ship with two T4 templates, both of which will produce EntityObject derived Entities. One in VB that produces VB code, and one in C# that produces, yes you guessed it, C# code.

Orjinal yazı için...