Sunday, February 6, 2011

Super Tower Defense 2

After a long time I played some online game, the game is Super Tower Defense 2, it is coded in Silverlight, it is a VERY BAD GAME because it stole my time from me.  I played it for nearly more than 2hrs at a stretch leaving all my college work and another activities to god.

The game is all about placing  different kind of turrets around our command center to protect it from enemy raids.  I think, ARACADE games still rock Open-mouthed smile

You also play it at": http://www.vectorlight.net/games/super_tower_defense_2.aspx

Hope one day even I could program something like that Smile with tongue out

Saturday, February 5, 2011

LIKE operation with LINQ and SQL

LIKE operator is a very useful and the most frequently used operator in SQL, with the advent of linq, we started to use linq more than SQL, i.e. small filtering is now done in code rather than going back to DB,  but the lack of proper LIKE operator is a bad aspect, per my research, in order to have a proper LIKE operator, we need to call the SQL Client and then use its functionality through linq and many suggest not to do it.

Hope Microsoft deals with small things too. Sad smile

However, I don’t know if it is Good for MIcrosoft to give the same functionality with “Contains” method Smile with tongue out,  Yes, that is correct, the like can be fully implemented with the help of Contains method.

MS Rocks some times.

Custom Data Column in Silverlight

 

Well, following is the code for creating a custom column with button or what ever is required in a datagrid

<sdk:DataGrid AutoGenerateColumns="False">
            <sdk:DataGrid.Columns>
                <sdk:DataGridTemplateColumn CanUserReorder="True" CanUserResize="True" CanUserSort="True" Header="Show Details" IsReadOnly="True" Width="100">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <Button x:Name="ShowContact" Content="Show" Click="ShowContact_Click" Tag="{Binding ContactID}"/>
                            </StackPanel>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
        </sdk:DataGrid>

Certain names and bindings are used a example only.