Wednesday, 31 July 2013

What is DataView in asp.net with Example? What are the advantages?


A DataView provides various views of the data stored in a DataTable. Using a DataView, you can expose the data in a table with different sort orders, and you can filter the data by row state or based on a filter expression.

DataView Example:

public void BindGridDataAll()
    {
        DataSet ds = new DataSet();
       //Get data from database and fill into dataset        
        ds = ObjClass.GetData();
        dvData = ds.Tables[0].DefaultView;
        // Here we specify which column you want to sort
         dvData.Sort = "SortString";
         GridView.DataSource = dvData;
         GridView.DataBind();
    }

C# - How to add DataTable to DataSet and DataSet to DataTable in asp.net?


Dataset

DataSet objects are in-memory representations of data. They contain multiple Datatable objects, which contain columns and rows, just like normal database tables. You can even define relations between tables to create parent-child relationships. The DataSet is specifically designed to help manage data in memory and to support disconnected operations on data, when such a scenario make sense. The DataSet is an object that is used by all of the Data Providers, which is why it does not have a Data Provider specific prefix.


Data Table

Data table is a collection of records that consist the single table. You can get dataTable from dataset as follows.

How to create a setup project for a Windows Service application in Visual C#


Requirements
The following list outlines the recommended hardware, software, network infrastructure, and service packs that you must have:
  1. Microsoft Windows 2000, Windows XP, Windows Server 2003, or a later Microsoft operating system with the .NET Framework installed
  2. Microsoft Visual Studio .NET Enterprise, Microsoft Visual Studio .NET Enterprise Architect, Microsoft Visual Studio 2005, or Microsoft Visual Studio 2008.

Saturday, 27 July 2013

Types of Bindings in WCF

Basic binding

Offered by the BasicHttpBinding class, basic binding is designed to expose a WCF service as a legacy ASMX web service so that old clients can work with new services. The basic binding makes your service look, on the wire, like a legacy web service that communicates over the basic web service profile. When used by clients, this binding enables new WCF clients to work with old ASMX services.

TCP binding

Offered by the NetTcpBinding class, TCP binding uses TCP for cross-machine communication on the intranet. It supports a variety of features, including reliability, transactions, and security, and is optimized for WCF-to-WCF communication. As a result, it requires both the client and the service to use WCF.

Features of WCF



WCF includes the following set of features. For more information, see WCF Feature Details.

  • Security 

    Messages can be encrypted to protect privacy and you can require users to authenticate themselves before being allowed to receive messages. Security can be implemented using well-known standards such as SSL or WS-Secure Conversation. For more information, see
     Windows Communication Foundation Security.

WCF interview questions



          Windows Communication Foundation (WCF) is an SDK for developing and deploying services on Windows. WCF provides a runtime environment for services, enabling you to expose CLR types as services, and to consume other services as CLR types. 

            WCF is part of .NET 3.0 and requires .NET 2.0, so it can only run on systems that support it.

             It is a Software development kit for developing services on Windows. WCF is introduced in .NET 3.0. In the System.ServiceModel namespace. WCF is based on basic concepts of Service oriented architecture (SOA)

1)      What are contracts in WCF?

In WCF, all services expose contracts. The contract is a platform-neutral and standard way of describing what the service does.

WCF defines four types of contracts.

Friday, 26 July 2013

Web Service interview questions



1)      What is the Web service protocol stack?

The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services. The core protocol stack consists of four layers:

Service Transport: This layer is responsible for transporting messages between applications. Currently, this includes HTTP, SMTP, FTP, and newer protocols, such as Blocks Extensible Exchange Protocol (BEEP).