Pages

Monday, December 3, 2012

Partial View in MVC

A partial view is a fragment of the code that can be reused in some other view; this will help us in reducing the duplicate code.  We can say a partial view in MVC is some what similar to the normal user controls in the traditional ASP.NET.  There can be 2 different form of these depending upon the engine you are using for the same for example in Razor engine it will be saved as .cshtml and for asp engine it will be a normal user control that is .ascx

The partial view will be very helpful in the websites or pages where there are multiple section present in the same page for example a New site where multiple section for each kind of news are present. We can create all these section in various partial views thus there will be lesser amount of code will be required and it will become easier to manage. Other example of partial views can be the icon which we used for the social book marking.

Partial views are only a subset of the view as the View can produces the entire HTML page but the partial view only create a part of the page, we can not specify the layout of the page using partial view for this we should have to make use of the View.

We can create the partial view by Right Clicking on the View >> Shared Folder and then add a new view and make sure you select the Checkbox for making it as a partial view. It is advisable to create the partial view in the shared folder as it is a good practice.



For calling the partial view we make use of the Helper method. “Renderpartial”, Please check the below sample code.

<div class="clear">
       <%Html.Partial("ViewTest1") %>
</div>


The partial view returns an action method as follows

public class Test
{
  public ActionResult getDetails()
  {
     return PartialView(); 
  }

}



Hope you will like this post and get more idea about the partial view in MVC. Please feel free to provide your valuable comment on this post so that I can improve and can create some more valuable articles, Cheers

Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC,DNS MVM


Wednesday, November 21, 2012

Windows Azure Components


Cloud computing is the future of application development and it is getting more and more popular day by day. Azure is a platform for cloud computing given by Microsoft. We can use this platform to build a web application/ web site that runs and stores data in Microsoft Cloud datacenters. We can create and deploy our web applications using the Visual studio and Windows Azure. For this we need to have an account in the Windows Azure platform.  Luckily the 90 Days Trial for Windows Azure is available from Microsoft. The Requirement is just to have a Windows Live ID and a valid credit card to authenticate you.

We can use Windows Azure for a Virtual machine, a Web site or for a Cloud service.  The Azure is consisting of various components. In this article I am going to describe that entire Component with some brief details. The knowledge of these are important in order to understand the functionality of Windows Azure.
We can divide the Azure in the following main components which are made up of smaller parts. The basic building blocks for Azure are.
  • ØExecution Models
  • Ø  Data Management
  • Ø  Networking
  • Ø  Business Analytics
  • Ø  Messaging
  • Ø  Caching
  • Ø  Identity
  • Ø  High performance Computing
  • Ø  Media
  • Ø  Commerce
  • Ø  &  SDK’s

These components are then future made up of the individual parts that are described below.

Execution Models:-
ü  Virtual machine
ü  Web Site
ü  Cloud Services
Data management:-
ü  SQL Database
ü  Tables
ü  Blob
Networking :-
ü  Virtual Network
ü  Connect
ü  Traffic manager

Business Analytics :-
ü  SQL Reporting
ü  Hadoop

Messaging :-
ü  Queues
ü  Service Bus

Caching :-
ü  Caching
ü  CDN

Identity :-
ü  Windows Azure Active Directory


High performance Computing :-
ü  HPC Scheduler

Media :-
ü  Media Service

Commerce :-
ü  Market Place

SDK  :-
ü  JAVA
ü  .NET
ü  PHP
ü  PYTHON


Details of these components are as follows.

Virtual Machine:-  Azure  can be used as a virtual machine in order to save time and cost. We just need to specify the Virtual Hard Disc (VHD) and the VM space required, thus it can only be used as and when an image or data arise. The same can also be moved out of Cloud service to work locally.

Web Sites:  This is the most common use of Cloud computing where the data used in the web sites are stored in the cloud data centers. IIS manages the web sites and we can move the IIS in Azure to take care of the data and information management. The development and storage can be from any language from .Net, PHP to SQL or any other relational data base.

Cloud Service:  Some time the application is not required a lot of administration instead we need to do a lot of operation that are not frequent thus in that case we can use Azure as a service or we can say platform as a Service. Azure is the best option is to use in this case which gives us a lot of flexibility and scalability to test or create the environment with multiple users, shutting or starting any running instance or modification in it with a low cost hosting environment.

SQL Data Base: Azure gives us choice for storing our data in Cloud platform. If our application is such that we require a relational data base to store our data in that case the Azure provide us the SQL data base with full feature to store our data. The control is in our hand thus we can manage that that all is going to access our data base and it gives us the flexibility to create replica of data base to reduce the down time.

Tables:-  is our data base is very large but there is no complex calculation in data in that case we need not to  have a complete relational data base. In this case there is an option to store our data in a structure which is fast and reliable. Here come the TABLES where the data is store in the plain tables for fast access. An example of data storage is the Key values pair where data is store with a key so that it can be retrieve faster.

Blob: The Other option to store the Data in cloud is the “Blob” where the data is stored in a binary format that is unstructured. This is useful if we are simply having a backup of any data or information where the Data is important not the structure..

Virtual network:  In this case the cloud will work as simply as the extension of our local network. As we can have virtual machine on cloud that to when required. It act as a Virtual Private Network (VPN) which can be set by the admin and we can connect to this network using a VPN gateway device.

Connect: If we do not want to create a VPN and simply need to connect with the clod platform in this case there is option to use Azure as direct connect. In this case we will establish a secure connection to Azure provided they are windows machine. It just requires to install the connect software in the developer machine.

Traffic manager: In scenario where the user of the application are scattered around the world and the application need to connect to the data center that is nearest to machine to overcome the response time, but if that data center is overloaded and you have to route the request to some other data center in this case the Azure Traffic manager is used. Here certain rules are defined by the developer for the routing. Azure then evaluate these rules to map the traffic.

SQL Reporting: this is the important business activity to have reports based on the data stored in the data center data base. Azure has the option to provide reports using the SQL reporting. we can create the reports for the application running on the Azure platform. Reports can be created in various data formats for example PDF, CML and Excel etc.

Hadoop: Hadoop is a dominant technology in the market to handle large amount of data that is not easily handled by the traditional RDBM, due to its size or the type of data. E.g. the server logs for and old system Hadoop is an Apache open source which stores the data in Hadoop Distributed File System (HDFS) to store data. A developer can create a mapReduce job to analyze data. The data in HDFS can be stored in distributed/ multiple servers. The mapReduce job can be run on each server to do the processing parallel.

Queues: the interaction between the codes on Azure is done by 2 ways the simple one is Queue, Queue is a simple data structure of the FIFO format, where the sender puts his message and the same can be read the receiver. After putting the message in queue the sender can perform another job by making the transfer asynchronously.

Service Bus:  this is another way of communication in Azure between the applications. The service buses internally use a Queue to handle the Request. This Queue’s are not similar to the earlier Queue but based in a Published and Subscribe mechanism. Here is the same message can be subscribed by multiple clients thus there will be One 2 Many relations. The service buses offer the communication between the applications that are also running out of the Cloud platform.

Caching:- Caching is the mechanisms to improve the performance by reducing the time to load the similar data again and again. Azure too support this Caching where the frequent accessed data weather it is a Database,  a Table or a Blob data. A VM can store the data in their memory for caching. Using the configuration and application setting the developer can also store the session data in Azure cache.

CDN:- CDN stands for Content delivery network, it is Quite useful when there is a large number of users accessing the similar data, in this case the caching will not work.  For example Software updates. CDN has multiple sites across the world which holds or store the information geographically for content or BLOB access by a user. Thus if the similar request arise the same can be routed to CDN for the faster access.

Identity: Microsoft Windows Azure Active Directory is the service which handles the identity in the cloud platform, that is who is the user and how the system will interact with this user. It is similar to the directory service where the user information and their organization information are stored which is called Identity. There is an API given to access the information from directory which is called Windows Azure Active Directory Graph which can give you the information about the user. To handles information about the user from outside the world like Twitter and Face book there is a separate service which is called  Windows Azure Active Directory Access Control, it simply convert the information in a common format that can be used in Azure platform as well.

High performance Computing: A better way to use the Cloud computing is to execute the application parallel, where the request can be processed or executed in multiple VM same time, this will increase the performance. For doing so we required some sort of scheduler, in Azure this can be done using HPC Scheduler.

Media: Azure can support a rich media content write from HD Audio, HD Video to other high definition content.

Commerce: Windows Azure Marketplace. The Windows Azure Marketplace is a global online market for SaaS applications and premium datasets. By listing your Windows Azure-based applications on the marketplace, you can commerce-enable and sell your applications internationally. Plus, you can subscribe to a range of premium datasets listed in the marketplace within your applications or monetize and distribute your own datasets through the marketplace.

SDK: Azure provides the SDK for various languages for the developer across the stream to build application that can run on the Windows Azure Cloud platform. The SDK available are for .NET, PHP, PYTHON and Java. These can be downloadable from Microsoft site.
  
 For more details on Azure you can log in to the official Azure site. http://www.windowsazure.com/en-us/ I have searched a lot of sites for compiling this content in easy language, so that the concept will become much more easier than it looks. Please provide your valuable comments on the article so that I can improve myself and create some more better articles on the same. Thanks You..


Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC,DNS MVM




Saturday, October 27, 2012

Windows 8 Some cool new features



Microsoft’s most promisable product that is Windows 8 has finally arrived in India. It is launched in INDIA before USA. The Advantage is we can easily upgrade from our existing Windows 7 to Windows 8 by just paying Rs. 699. Microsoft is a market leader in the operating system since last 2 decades and here comes the most existing operating system with a lot of cool new features. Here are some of the features you would like to check…



Smooth Touch
Windows 8 supports intuitive simple touch gestures like swipe to left and swipe to right from the charm. Semantic zoom is also a cool feature given by windows 8. Semantic Zoom is a touch-optimized technique used by Windows Store apps in Windows 8 for presenting and navigating large sets of related data or content within a single view (such as a photo album, app list, or address book).

Tiles and Lock Screen
This feature will let you enable having the notification in the home screen without even opening them. This will be very helpful in the application like outlook.
The lock screen in Windows 8 is also become an exciting one. We can see the updates of a maximum of seven apps in the lock screen they will constantly run in the background and send notifications to the lock screen. We can have the option to select between the Weather and Calendar apps to show information on the Lock Screen at all times. This will be helpful if you have any todo task which will be informed while the screen is locked.



Deep Search
A powerful searching option is present in Windows 8 for files, apps, If an application is having their inbuilt search then the Windows 8 can let you search that directly also from home screen, we just have to type the search keyword.  A search can also be included in a search engine directly by simply adding the Bing application in it. Isn’t it cool???




Refresh and Reset
Refreshing the PC while it becomes slow is also changed it just need a single tap now to reset your machine, without changing any of your files. With just a tap all of your settings will be changed back to the default...
Reset is the cool option that let you set the existing setting from any user.  We can simply reset the OS for a fresher look and the worry to delete all files are gone. You can find both features in the Charms bar: Click Settings choose “Change PC Settings” and go to the “General” section.

Sync with Other device
The Synchronization between the PC, Mobile and tablet is also become very easy with Windows 8. Microsoft let you have an account and which is cloud-friendly; All of the personalization’s Setting can be stored in clouds. “Sync your settings” option within your OS settings lets you sync personalization’s (wall paper, colors, lock screen and Avatar), passwords, language preferences, app settings, browser settings, and more.

Multitasking / Snap View
This feature let you work on multiple  application at the same time with the active one will taking a large space in the screen and the other will simply take a very small space thus the switching between the application is no more a pain now. It’s quit helpful while we chat with someone and searching something at the same time.

Pin/Unpin
The Start Screen becomes more powerful and friendly where we can place some of our useful application to have the live updates. Example we can pin individuals from the People hub directly in Start Screen for quick access. You can always pin and un-pin items from your Start Screen.

Go Social with sharing
Sharing is become a fun in Windows 8, if anything is useful and you want to share the same with friends and circle simply  open charms bar and tap the Share button , it will detect automatically where this need to be shared irrespective of content whether it is an image, link or section of a application. Social networks and e-mail sharing can be done using the share menu at the same time sharing between multiple applications is also possible.



Task Manager
Task Manager in Windows 8’s has got a lot of improvement with multiple new feature. If an application is running we can check complete list of everything that’s running on your device, separated by section: apps, background processes, and Windows processes.
Device’s resources utilization of each app or process can be seen. The Performance tab gives you details of CPU, Memory, and Disk, Bluetooth, and Wi-Fi usage in the form of charts.  App history shows you how much CPU and bandwidth your apps have used over time, making it easy to identify which apps take the most resources. The Startup tab lets you set the apps for default running. The Users tab shows you usage based on the devices various users, while the Services tab lets you go through your services to restart services.




Keyboard Shortcut
Windows 8 is touch enable OS but the basic way of using operating system using the keyboard keys is not out. Microsoft has given hundreds of new keyboard shortcuts to access apps and its features.
Windows logo key + type key word: Search your PC
Ctrl+plus (+) or Ctrl+minus (-): Zoom in or out of many items, like apps pinned to the Start screen or in the Store
Ctrl+scroll wheel: Zoom in or out of many items, like apps pinned to the Start screen or in the Store
Windows logo key + C: Open the charms
Windows logo key + F: Open the Search charm
Windows logo key +H: Open the Share charm
Windows logo key +I: Open the Settings charm
Windows logo key + K: Open the Devices charm
Windows logo key + O: Lock the screen orientation (portrait or landscape)
Windows logo key + Z: Open commands for the app
Windows logo key + PgUp: Move the Start screen and apps to the monitor on the right (apps in the desktop won’t change monitors)
Windows logo key + PgDn: Move the Start screen and apps to the monitor on the left (apps in the desktop won’t change monitors)
Windows logo key + Shift+period (.): Snap an app to the left
Windows logo key + period (.): Snap an app to the right

I hope you will like all of the new features offered in Windows8. It is officially launched and this can be upgraded very easily. I have searched a lot of websites to compile this content. Thanks to all of them for providing the list of new features. Please feel free to post your suggestion and comment about this post.

Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC,DNS MVM

Thursday, October 4, 2012

SYNONYM in SQL Server


A synonym is an identifier that can be used to refer an object from the data base that is having a very long name. Thus instead of using the long name every time we can have the alias or synonym. It gives us and extra layer of security as we have only the Abstract of the object in the form of name which helps us if the underlying object is changed or modified.
We can refer the synonym to perform operations on the base object. We can also use a synonym to refer objects on a linked server, thereby masking the server name.
  • We can use a synonym to refer a base object in the following type of Query:
    • SELECT, including sub queries
    • INSERT
    • UPDATE
    • DELETE
    • EXECUTE

There are some limitations while using synonym like we cannot use a synonym in a Data Definition Language (DDL) statement, such as an ALTER TABLE command. Synonyms are not schema bound; therefore, they cannot be referenced by schema bound objects like
Ø  CHECK constraints
Ø  Computed columns
Ø  Defaults
Ø  Rules
Ø  Schema-bound views and functions

To create a synonym,

USE UrDBName;
GO
CREATE SYNONYM MySyn
FOR UrDBName.ObjectNsame
GO

Use Synonyms :

USE test;
GO
SELECT * FROM MySyn;
GO


To drop a synonym, all you need to do is execute the DROP SYNONYM command followed by the synonym name or right-click the synonym and select delete from the context menu.

DROP SYNONYM [schema].SynonymName


You can always delete a synonym even if other objects are referencing it. we will not encounter an error until executing the object that references the synonym.
Hope this is useful in getting idea about the same. Please provide your valuable comment on the same.

Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC,DNS MVM

Monday, September 17, 2012

Biz Talk Server 2010 Artifacts



Hi Friends,
             A lot of people get confused when they hear the word Artifact when they are with Biz Talk Server, This time I am writing this article for the Artifacts present in the BizTalk Server 2010. Artifacts are the objects that are used within the Biz talk server and all these objects are referred as Artifacts. Here are some of the common used Artifacts in BTS which any user came across while working with the BTS. These artifacts are used in various section or location of the BTS like Biz Talk Server Administration Console, Biz Talk Server Administration Explorer and inside Orchestration View.




                                     (Fig: Typical Biz Talk server processing)

   1.      Server

A Biz talk server is the tool for a message based connection between various applications within an organization. This is comprises of It consists of several tools like Business Processes (Orchestrations), Business Activity Monitoring (BAM), HAT (Health and Activity Tracking), Rules Engines, BizTalk Server Administrative Console etc.

   2.      Message Box
A Message box is the Core part of the messaging system in BTS. This is Responsible for communication and routing of the messages to and from the BizTalk Server. It is Comprises of a messages data base and an agent for sending the messages from or to the system. Genrally SQL data base is uses for the storing of message.


   3.      Host
A BizTalk Host object is a Logical entity that represents a logical set of one or more runtime processes in which you can deploy services, pipelines, and other artifacts. The Host object also represents a collection of runtime instances (one or more) where the deployed items physically run.


   4.     Adapter
To communicate with various kinds of protocols BTS uses a system that is called Adapter. BizTalk uses a variety of adapters for communications with different protocols, message formats, and specific software products. Some commonly used adapters are  EDI, File, HTTP, FTP, SFTP, SMTP, POP3, SOAP, SQL, MSMQ, Microsoft SharePoint Server.

   5.      Receive handlers
 Adapter handler is an instance of a host where we can run the code for communication.
An adapter handler is responsible for executing the adapter code and contains properties for a specific instance of an adapter. A receive handler is an adapter that is used to execute the code for receiving messages.

   6.      Send handlers
A Send handler is an adapter that is used to execute the code for sending the messages from BTS.
  
   7.      Assembly
Assemblies are the basic building blocks of .NET Framework applications. These are fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. In order to use them in BTS they must be registered in GAC (Global Assembly cache).

   8.      Orchestration
This is the most important part of a BTS.  An Orchestration is a graphical representation of a Business logic flow with various set of predefined shapes of BTS. BizTalk orchestration is a flexible and powerful capability that provides various services and tools to enable you to design, automate, and manage business processes. An orchestration can represent the complete business logic which we do in traditional procedural programming language. This is similar to the shapes and code we use to do in the Windows Workflow Foundation (WWF).

   9.      Roles
Set of rules are defined for each user in the BTS. These Rules are commonly referred as Roles in BTS for example a BTS Administration, Developer Roles etc.


   10.  Port
A BTS port is an object that is used to send messages from BTS to other system and from other system to BTS. Without using Ports we cannot communicate with systems.

   11.  Send Port
A send port is a BizTalk port that is responsible for sending the messages from BTS system to another system.

   12.  Receive Port
A Receive port is a BizTalk port that is responsible for getting or Receiving / reading the messages from any system to BTS.

    13.  Port Type
A Port type is the communication pattern, a set of operations (requests or responses), and the message types which is used in BTS for performing any operation. The pattern used in port type can be either one-way or request-response (two-way), and all operations defined on that port type must use the same pattern.

   14.  Multi part message Type
A message which in turns the combination of multiple messages is referred as a multi part message type. These parts are defined by XML Schema Definition (XSD) language schemas or .NET classes. You can define your own multi-part message types.
  
   15.  Maps
A Map is an XML file that defines the relations between the records and fields in one Schema to another. This is a one to one relationship where we can map the incoming value to the outgoing value.  A map contains an Extensible Style sheet Language (XSL) which is used by BizTalk Server to perform the transformation described in the map.
  
    16.  Entry Points
Entry point is the location in an Orchestration from where the execution of the orchestration gets start. Normally it starts with receiving a message from external message and then the execution is start. So it is generally a Receive message shape in orchestration.

     17.  Pipelines
A Pipeline is a the set of code or command that defines and links one or more processing stages, or different unit to communicate with, and running them in prescribed order to complete a specific task. Pipelines divide processing into stages and bridge the gap between components for stages.

     18.  Schema
Schema is the normal XML file schema which defines the Records, Fields element and Attribute of an element. This is used to specify the structure of the message as well. All the things inside a BTS is represented in XML only. A schema can contain multiple subschemas.
   
19.  Resources 
A resource is any File, assembly or a script which is the part of the application and is deployed with the application.


    
20.   Policies 
A Policy is the set of rules written by the administrator to control the logic of the orchestration. This is the set of Business rules which are controlled using the version numbers.



Hope you have got the basic information about these artifacts of Biz talk server and like this article. I have taken the help of MSDN as well as Biz talk server official website to provide more information on these various artifacts, Please refer MSDN if you required any other detailed information about the same.  I will come up with some more articles on the BizTalk server soon.
Please do share your valuable comments on this.




Thanks
Anil Kumar Pandey
Microsoft MVP, Microsoft MCC,DNS MVM

Kontera