Tuesday, November 27, 2012

Difference between WCF and Web service

Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service. Following points provides detailed difference between them.


Web Service:




  • Hosting -It can be hosted in IIS.

  • Programming -[WebService] attribute has to be added to the class.

Features of WCF

WCF includes the following set of features:

Service Orientation 

One consequence of using WS standards is that WCF enables you to create service oriented applications. Service-oriented architecture (SOA) is the reliance on Web services to send and receive data. The services have the general advantage of being loosely-coupled instead of hard-coded from one application to another. A loosely-coupled relationship implies that any client created on any platform can connect to any service as long as the essential contracts are met.

Windows Communication Foundation


Important Sql Queries

Introduction: In this article i am going to give some of very useful SQL Queries that are required to us in our day to day programming life.

1. Get current Database Name:  Select DB_NAME()


2. Get Details Of All Databases Present In SQL Server: Select * from sys.databases


3. Rename A Database: Exec sp_renamedb ‘oldDatabaseName’ , ‘newDatabaseName’

Dataset Vs DataReader

Introduction: Following are some of the differences between DataSet and DataReader objects in .NET.























































        Dataset          DataReader


  • It is used in disconnected architecture




  • It is connection oriented.




  • Works with multiple tables




  • Works with single tables




  • Forward and backward scanning of data.




  • Only forward scanning is possible




  • We can make several edits on the dataset.




  • It is read only record set.




  • Occupy more memory




  • Occupy less memory.




  • Relationship can be maintained




  • Relationship can’t be maintained.




  • Relatively slower data access




  • Faster than data set.




  • Works with multiple records at a time.




  • Works with only 1 record at a time.




  • Transactions can be handled




  • No transaction can be handled as its read only.




  • Can be bind to multiple controls




  • Can be bind to a single control only




  • More overhead in memory as it is heavyweight




  • Lightweight object hence very less overhead




  • Supported by VS.Net tools




  • Must be manually coded.