Silver Hawk – A Silverlight Game

Posted on April, 8 at 3:30 pm

1 Comment »

Silver Hawk is my first silverlight game which i have developed a year ago in Silverlight 2.0. This game is also featured in “Server Quest Competition” conducted by Microsoft and stood as one of the top rated game.

Here you go :
Play SilverHawk and some more Games developed by us. Read the rest of this entry »

Categories : Games, Silverlight
Tags : ,
Author : Kranthi Gullapalli

async, await and task in C# 4.5

Posted on September, 16 at 8:23 pm

No Comments »

The Task-based Asynchronous Pattern (popular as TAP) is a new pattern for asynchrony in the .NET Framework.  It is based on the Task and Task<TResult> types in the System.Threading.Tasks namespace.  There are three new keywords to learn about, before we dive into more details.

Task: task is an asynchronous operation, which creates a new Thread or ThreadPool in background. Tasks provides more programmatic control than a Thread and also more efficient.

await: await operation is used in an asynchronous method to suspend the execution, till a particular task completes. To use await operator, the method should be marked as ‘async’. Read the rest of this entry »

Categories : Basics, DotNet
Tags : , ,
Author : Siva Kuchi

Generalizing Dropdown generation via Templating using Reflection in MVC

Posted on August, 9 at 7:37 am

No Comments »

In our project we are using reflection to generate the form controls based on the ViewModel. We need a way to differentiate between properties which are to be rendered as dropdownlists on view.

General Solution which was already implemented:

  • Looping through all the properties of View Model

    @{
         var modelProperties = ViewData.ModelMetadata.Properties.Where(prop => (!(prop.Model is ICollection || prop.PropertyName.Equals("Id")))).ToArray();
         var LookUp = ViewBag.LookupData as IClientSearchRepository;
    }
    @foreach (var prop in modelProperties)
    {
        //Code to render contol based on property goes here
    }
    
  • Checking whether the current property is to be displayed as dropdown based on displayname which is mentioned on property attributes

    @if (prop.DisplayName == "State")
    {
         @(Html.DropDownListFor(model => model.State, LookUp.GetStates(), prop.DisplayName))
    }
    
  • Read the rest of this entry »

    Categories : Asp.Net MVC
    Tags : , , ,
    Author : Kranthi Gullapalli

    DefiningQuery Vs QueryView in Entity Framework

    Posted on July, 24 at 7:13 am

    No Comments »

    With the increasing usage of OR mappers, Entity framework got more lime light and most of the developers are now working on it. It has lot of needed implementations than Linq to SQL.

    Recently, I stuck in a situation, where I need to implement a conceptual model which doesn’t exist in the database. I browsed for the ways to do that and came to know that EF supports this in two ways and the decision can be taken after reviewing pros and cons of these. The two ways are “Defining Query” and “Query View”. Read the rest of this entry »

    Categories : ASP.Net, EntityFrameWork, Linq To SQL
    Tags : , ,
    Author : Siva Kuchi

    Generic version of HttpResponseMessage (i.e. HttpResponseMessage<T>) is removed from Asp.Net Web API

    Posted on July, 17 at 7:10 am

    2 Comments »

    These days I got the chance to work on Asp.Net web API. In my project we used Wcf web API to expose the services.Recently Microsoft has released Asp.Net Web API which is the combination of MVC and Wcf Web API.My architect team suggested us to migrate the Wcf Web API to ASP.NET Web API because of its extensive features.

    During this migration I found that generic type of HttpResponseMessage is not available in Asp.Net Web API.HttpResponseMessage class was introduced in WCf Web API to take more control over the HTTP response.

    I went through the release notes of ASP.NET web API and found that the generic type has been removed.To create the HttpResponseMessage  Request.CreateResponse<T>(params) has been introduced in the latest style.

    Below is the difference in creating the HttpResponseMessage between Wcf Web API and Asp.Net Web API.

    Wcf Web API style:-

    Read the rest of this entry »

    Categories : Asp.Net Web API
    Tags : , ,
    Author : Kiran Gunda

    Visual Studio – EntityFramework -The Selected Store Procedure Returns no columns

    Posted on June, 14 at 5:31 pm

    No Comments »

    Some of you might experienced this “The Selected Store Procedure Returns no columns” while adding stored procedure into the entity model by adding function import and planning to map with complext type.

    The main reasons for this are

    1. You are returning your result set using dynamic sql, so EF can’t figure out at design time what the shape of the results will be.
    2. You are selecting from a temp table and EF can’t figure out the shape of the results at design time.

    Read the rest of this entry »

    Categories : EntityFrameWork, Visual Studio
    Tags : , ,
    Author : Praneeth

    Visual Studio 2010 hangs with the status message saying “Updating source control status” [Fixed]

    Posted on June, 8 at 11:36 am

    No Comments »

    Recently I have installed Asp.Net MVC 4 beta framework on my machine to explore the new features. But later that when I am opening my source controlled solution (using TFS) visual studio just hangs and the status message below says that “Updating source control status”. Not sure if this happens for other source controls too. I had no clue of why this is happening, tried restarting visual studio and even tried restarting my machine(dumb try though) , none of which fixed my issue. Later I started researching/googling and found a forum post where someone had the similar issue and someone else suggested the solution. Somehow I missed the direct link to that post, but here is the solution

    Read the rest of this entry »

    Categories : Asp.Net MVC, Visual Studio
    Tags : , , ,
    Author : Phani Bitra

    Export DataTable to Excel in Asp.Net without using excel interop – Part II

    Posted on April, 20 at 1:38 pm

    3 Comments »

    In my earlier post i have shown a way to export a datatable  as a excel document. But when we open the exported document, the data and all would be as expected but the gridlines that excel displays by default would be hidden. So again see these the user had to go to ribbon View Tab and should check the GridLines Checkbox to view those gridlines. But my reuirement was to enable them by default so that user would be comfortable as it would be the defaukt behavior of excel. Also I had to set the worksheet name. So to achive these two functionalities I had to modify the method “ExportToExcel” from my previous implementation.

    Read the rest of this entry »

    Categories : ASP.Net, DotNet, MS Excel
    Tags : , , ,
    Author : Phani Bitra

    Export DataTable to Excel in Asp.Net with sorting/filtering support without using excel interop

    Posted on January, 13 at 2:33 pm

    2 Comments »

    Recently I had a requirement for exporting a datatable to excel. This looks fairly simple to do as microsoft provides interop api to automate generation of excel, but the issue I had was I cannot use the interop api on the hosting I currently have. Another option i had was to generate the excel document using the OpenXML, but my requirement is to support even excel 2003 so this option is ruled out. Knowing the fact that excel can interpret Html table and render contents, I started of by generating equivalent Html table for the datatable and writing the content back with content type of excel. So this document can be opened using excel by default, but the only issue is it shows up a warning before opening. Later I also had a requiremnet to have Sorting/Filtering features which normally exists for a default table in excel. This was a bit tricky. Below is the source code walkthrough: Read the rest of this entry »

    Categories : ASP.Net, DotNet
    Tags :
    Author : Phani Bitra

    How To: Insert table into word document from asp.net applicaiton

    Posted on January, 13 at 12:35 pm

    No Comments »

    In my previous article i’ve explained how can we export data from asp.net application to a word document. If you have not read that article, i would recommend to read that article once.

    In this article i would like to explain how can we insert a table from asp.net application.
    Lets consider we have List (List of users) in our application and we need to export this data as a table into the word document, below is the procedure to do that.
    Read the rest of this entry »

    Categories : ASP.Net, MS WORD
    Tags : , , ,
    Author : Kranthi Gullapalli

    Interesting facts of equality operators in javascript

    Posted on January, 13 at 7:25 am

    No Comments »

    Equality operators are operators that compare two values ​​to determine whether they are identical or different and return a boolean (true or false) depending on the result of the comparison. For equality comparison we have two operators in javascript one is Equals(==) operator and the other is Strict Equals(===) operator.

    Read the rest of this entry »

    Categories : ASP.Net, Basics, Javascript, Jquery
    Tags : , , ,
    Author : Phani Bitra