Thursday, November 8, 2012

Free .NET Decompiler and Assembly Browser


I was a great fan of .Net reflector (http://www.reflector.net/) , but that application is purchased by Redgate and started charging licence fees  .

Recently i came across a free .Net decompiler -  dotpeek from jetbrains . it is really cool .. it has almost all features offered by .Net reflector. so its time to switch .


http://www.jetbrains.com/decompiler/


Monday, November 5, 2012

SQL Server - Query to get references & constraints of a table



Just substitute 'YOUR TABLE NAME'  to the name of the table you want to see Reference , Constraints and other relationships.


SELECT
    K_Table = FK.TABLE_NAME,
    FK_Column = CU.COLUMN_NAME,
    PK_Table = PK.TABLE_NAME,
    PK_Column = PT.COLUMN_NAME,
    Constraint_Name = C.CONSTRAINT_NAME
FROM
    INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS C
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK
    ON C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS PK
    ON C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE CU
    ON C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME
INNER JOIN (
            SELECT
                i1.TABLE_NAME,
                i2.COLUMN_NAME
            FROM
                INFORMATION_SCHEMA.TABLE_CONSTRAINTS i1
            INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE i2
                ON i1.CONSTRAINT_NAME = i2.CONSTRAINT_NAME
            WHERE
                i1.CONSTRAINT_TYPE = 'PRIMARY KEY'
                AND I1.TABLE_NAME = [YOUR TABLE NAME]
           ) PT
    ON PT.TABLE_NAME = PK.TABLE_NAME

Friday, August 10, 2012

REST Client - Firefox addon


RESTClient, a debugger for RESTful web services.


Today i tried REST Client addon for fire fox browser , its really cool.

About this Add-on

RESTClient supports all HTTP methods RFC2616 (HTTP/1.1) and RFC2518 (WebDAV). You can construct custom HTTP request (custom method with resources URI and HTTP request Body) to directly test requests against a server.

For download this addon - click here

Monday, July 9, 2012

ADO.NET Entity Framework


The Microsoft® ADO.NET Entity Framework is an Object/Relational Mapping (ORM) framework that enables developers to work with relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that developers usually need to write. Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects. The Entity Framework’s ORM implementation provides services like change tracking, identity resolution, lazy loading, and query translation so that developers can focus on their application-specific business logic rather than the data access fundamentals.

High-level capabilities of the Entity Framework:

Works with a variety of database servers (including Microsoft SQL Server, Oracle, and DB2)
Includes a rich mapping engine that can handle real-world database schemas and works well with stored procedures
Provides integrated Visual Studio tools to visually create entity models and to auto-generate models from an existing database. New databases can be deployed from a model, which can also be hand-edited for full control
Provides a Code First experience to create entity models using code. Code First can map to an existing database or generate a database from the model.
Integrates well into all the .NET application programming models including ASP.NET, Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), and WCF Data Services (formerly ADO.NET Data Services)
The Entity Framework is built on the existing ADO.NET provider model, with existing providers being updated additively to support the new Entity Framework functionality. Because of this, existing applications built on ADO.NET can be carried forward to the Entity Framework easily with a programming model that is familiar to ADO.NET developers.

Using the Entity Framework to write data-oriented applications provides the following benefits:
  • Reduced development time: the framework provides the core data access capabilities so developers can concentrate on application logic.
  • Developers can work in terms of a more application-centric object model, including types with inheritance, complex members, and relationships. In .NET Framework 4, the Entity Framework also supports Persistence Ignorance through Plain Old CLR Objects (POCO) entities.
  • Applications are freed from hard-coded dependencies on a particular data engine or storage schema by supporting a conceptual model that is independent of the physical/storage model.
  • Mappings between the object model and the storage-specific schema can change without changing the application code.
  • Language-Integrated Query support (called LINQ to Entities) provides IntelliSense and compile-time syntax validation for writing queries against a conceptual model.
More details please visit - http://msdn.microsoft.com/en-us/data/aa937709

Friday, June 15, 2012

JSON Parsing using JQuery

Takes a well-formed JSON string and returns the resulting JavaScript object.
  • version added: 1.4.1 

    usage  -- jQuery.parseJSON( json )

    json  --- The JSON string to parse.
Passing in a malformed JSON string may result in an exception being thrown. For example, the following are all malformed JSON strings:
  • {test: 1} (test does not have double quotes around it).
  • {'test': 1} ('test' is using single quotes instead of double quotes).
Additionally if you pass in nothing, an empty string, null, or undefined, 'null' will be returned from parseJSON. Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

Example:

Parse a JSON string.

var obj = jQuery.parseJSON('{"name":"John"}');
alert( obj.name === "John" );

Monday, April 23, 2012

How to view generated source by AJAX (or by JS)



One of the challenging things about debugging an AJAX application is that it isn't obvious how to view the html source that is being rendered by the browser after you have made modifications to it via an AJAX callback.  If you use the browser's built-in View Source command then it will show you the source that was used to render the original page, but it will not include any modifications made via javascript/AJAX calls.

If you are trying to view the generated source in Firefox, the simplest way is to first download and install the WebDeveloper extension   Then go to the View Source menu item and select "View Generated Source".
To view the generated source in IE you can type the following in the address bar


Monday, April 9, 2012

ASP.NET Profile Properties Overview

In many applications, you want to store and use information that is unique to a user. When a user visits your site, you can use the information you have stored to present the user with a personalized version of your Web application. Personalizing an application requires a number of elements: you must store the information using a unique user identifier, be able to recognize users when they visit again, and then fetch the user information as needed. To simplify your applications, you can use the ASP.NET profile feature, which can perform all of these tasks for you.

The ASP.NET profile feature associates information with an individual user and stores the information in a persistent format. Profiles allow you to manage user information without requiring you to create and maintain your own database. In addition, the ASP.NET profile feature makes the user information available using a strongly typed API that you can access from anywhere in your application.

You can store objects of any type using profiles. The profile feature provides a generic storage feature that allows you to define and maintain almost any kind of data while still making the data available in a type-safe manner.

You configure the profile feature by defining a list of properties whose values you want to maintain. For example, you might want to store the user's postal code so that your application can offer region-specific information, such as weather reports. In the configuration file, you would define a profile property named PostalCode. The profile section of the configuration file might look like the following:

  

When the user enters a postal code, you set a "profile" property to store the value for the current user, as in the following example:
Profile.PostalCode = txtPostalCode.Text;
 
When you want to use the value, you can get it in much the same way that
 you set it. For example, the following code example shows how to call 
an imaginary function named GetWeatherInfo, passing it the current user's postal code as stored in a profile: 

weatherInfo = GetWeatherInfo( Profile.PostalCode );
 
Please refer this MSDN article for more details.
 

Tuesday, March 6, 2012

JSONView - Firefox addon

Today i came across a firefox plug-in for viewing JSON Data.
After installing this plug in you can see JSON data formatted and highlighted in browser.
Can download JSON View from below link..
https://addons.mozilla.org/en-US/firefox/addon/jsonview/

Free REST service can try after installing JSON View.
http://api.worldbank.org/countries?format=json
 

ASP.NET Web API

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.

  • ASP.NET MVC includes ASP.NET Web API.
  • Choose either the Web Platform for Visual Studio 2010 or for Visual Studio 11, depending on which version you are running.
for samples , please visit -  http://www.asp.net/web-api/samples
for more details - http://www.asp.net/web-api

Monday, February 20, 2012

Single Page Application - ASP.Net

The ASP.NET Single Page Application (SPA) is a new feature in the ASP.NET MVC 4 beta preview. It provides a better end-to-end experience for building applications with significant client-side interactions using JavaScript.

   1. A set of JavaScript libraries for richer local interactions with cached data
   2. Additional Web API components for unit of work and DAL support
   3. An MVC project template with scaffolding to get started quickly



JavaScript Libraries

The JavaScript libraries include existing popular ones such as Knockout and History and a relatively new library called Upshot (formerly previewed as RIA/JS). Together they support presentation and editing of data across a set of pages that interact with local and remote data. They illustrate one prescriptive pattern of using distinct libraries together. You could also use them independently or replace one or more of them. For example, Upshot could be used with JsViews or jQuery UI or ISV controls and jQuery could be replaced with XUI. Some of the replacements may require some adaptation via a small library.

DataController on the Server

On the server-side, a new class called DataController which derives from ApiController, provides support for insert, update and delete operations in a unit of work with transaction support and automatic validations. It also provides a way to get the total count for paging along with the first page. It also provides a foundation for DAL-specific implementation of the above features. For example, DbController is a DataController that implements the above for Entity Framework Code First style of data access.

Single Page Application MVC Project Template

A new MVC project template for Single Page Application provides an educational tool and a way to start quickly. It includes scaffolding to generate a skeletal app that includes a DataController, optionally an Entity Framework DbContext and the scripts for basic query and edit tasks (CRUD operations). The template also includes a sample model class that you could use as is or replace with your favorite one to get started.

Can find more details from : http://www.asp.net/single-page-application/an-introduction-to-spa/overview/landingpage

Monday, February 6, 2012

Video and Audio with HTML 5

Yesterday i tried Video and Audio tags in HTML 5 , sharing some quick notes.
How It Works
To show a video in HTML5, this is all you need:


The control attribute adds video controls, like play, pause, and volume.
Video Formats and Browser Support

Browser
MP4
WebM
Ogg
Internet Explorer 9
YES
NO
NO
Firefox 4.0
NO
YES
YES
Google Chrome 6
YES
YES
YES
Apple Safari 5
YES
NO
NO
Opera 10.6
NO
YES
YES

MP4 = MPEG 4 files with H264 video codec and AAC audio codec
WebM = WebM files with VP8 video codec and Vorbis audio codec
Ogg = Ogg files with Theora video codec and Vorbis audio codec


To play an audio file in HTML5, this is all you need:




Audio Formats and Browser Support
Currently, there are 3 supported file formats for the

Browser
MP3
Wav
Ogg
Internet Explorer 9
YES
NO
NO
Firefox 4.0
NO
YES
YES
Google Chrome 6
YES
YES
YES
Apple Safari 5
YES
YES
NO
Opera 10.6
NO
YES
YES

Monday, January 16, 2012

Creating new Team project group in TFS

You can create security groups for your team project to better meet the security requirements of your organization. Creating a security group is an efficient way to grant a specific set of permissions to a group of users on your team project. Make sure that you allow only the minimum permissions necessary for the group, and add only those users or groups who must belong to this new team project group. If you must create a group that is not project-specific, consider creating a server-level group instead

Required Permissions

To perform this procedure, you must be a member of the Project Administrators group

To create a team project group

  1. In Team Explorer, select the team project for which you want to create a group.
  2. On the Team menu, point to Team Project Settings, and then click Group Membership.
  3. In the Project Groups dialog box, click New.
  4. In the Create New Team Foundation Server Group dialog box, in the Group Name box, type the name for the team project group.
  5. In the Description box, type a description for the group.
  6. Click OK.

Thursday, January 12, 2012

Insights to Knockout JS (KO)

Introduction

Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model. Any time you have sections of UI that update dynamically (e.g., changing depending on the user’s actions or when an external data source changes), KO can help you implement it more simply and maintainably.

Headline features:
  • Elegant dependency tracking - automatically updates the right parts of your UI whenever your data model changes
  • Declarative bindings - a simple and obvious way to connect parts of your UI to your data model
  • Flexible and sophisticated templating - construct a complex dynamic UI easily using arbitrarily nested templates
  • Trivially extensible - implement custom behaviors as new declarative bindings for easy reuse in just a few lines of code
Additional benefits:
  • Pure JavaScript library - works with any server or client-side technology
  • Can be added on top of your existing web application without requiring major architectural changes
  • Compact - around 25kb before gzipping
  • Works on any mainstream browser (IE 6+, Firefox 2+, Chrome, Safari, others)
  • Comprehensive suite of specifications (developed BDD-style) means its correct functioning can easily be verified on new browsers and platforms

Installation

Knockout’s core library is pure JavaScript and doesn’t depend on any other libraries. So, to add KO to your project, just follow these steps:
  1. Download the latest version of the Knockout JavaScript file from here. For normal development and production use, use the default, minified version (knockout-x.y.z.js).
    For debugging only, use the larger, non-minified version (knockout-x.y.z.debug.js). This behaves the same as the minified version, but has human-readable source code with full variable names and comments, and does not hide internal APIs.
  2. Reference the file using a

Friday, January 6, 2012

jStorage - store data locally with JavaScript

jStorage is a simple wrapper plugin for Prototype, MooTools and jQuery to cache data (string, numbers, objects, even XML nodes) on browser side. Note that functions, DOM nodes, host objects and such can not be saved.

jStorage makes use of HTML5 local storage where available and userData behavior in Internet Explorer older versions. Webkit SQLite is not supported.
Current availability: jStorage supports all major browsers - Internet Explorer 6+, Firefox 2+, Safari 4+, Chrome 4+, Opera 10.50+
If the browser doesn't support data caching, then no exceptions are raised - jStorage can still be used by the script but nothing is actually stored.
jStorage is really small, just about 2 kB when minified (under 1kB when gzipped)!

Browser Storage support Survives browser restart Survives browser crash Storage size
Chrome 4 + + + 5 MB
Firefox 3.6 + + + 5 MB
Firefox 3 + + + 5 MB
Firefox 2 + + + 5 MB
IE8 + + + 10 MB
IE7 + + + 128 kB
IE6 + + + 128 kB
Opera 10.50 + + - 5 MB
Opera 10.10 - N/A N/A N/A
Safari 4 + + + 5 MB
Iphone Safari + + + 5 MB
Safari 3 - N/A N/A N/A


jStorage can be downloaded at github (direct download link)