Monday, August 24, 2015

How to show confirmation alert before closing browser tab using JavaScript

In this article I am going to explain how to show confirmation alert before closing browser tab using JavaScript

Description:

When users enter the data or update the data on webform but in between by mistake users click on close tab and lost the all enter/update data. After all user have to again open that particular form and again insert/update the data.
To avoid inconvenience I am going to show a pop up message when users click on close tab.

Sunday, August 23, 2015

Search records from Sql Server database using Linq to Sql

In this article I am going to explain how to search the records from Sql server database using Linq to Sql.

Description:

I have a table Movie. I want to filter/search the records on the basis of movie name and display the record in Gridview data control.
Search records from Sql Server database using Linq to Sql

Implementation:
Add a webform to project/website. Drag and drop the Gridview control from toolbox to

Friday, August 21, 2015

WCF tutorial to Insert, Bind, Edit, update and Delete the record from sql server database in Asp.net

In this tutorial I am going to explain how to Insert, Bind, Edit, update and Delete the record using WCF service from sql server database in Asp.net using C#

Description:

We have to perform the following task to Insert, Bind, Edit, update and Delete the record into Sql Server database:
Create Database and table
Create a WCF service
Create a Web application (Website) to consume the WCF service

Implementation:
I have created a Table Movie:

WCF tutorial to Insert, Bind, Edit, update and Delete the record from sql server database in Asp.net

Create store procedures to Insert, Update, Delete and fetch record.

Monday, August 17, 2015

Display records in Gridview from sql server database using WCF service

In this article I am going to explain how to Display records in Gridview from sql server database using WCF service in asp.net

Description:

I have created a table Movie and it has the records. 

To display the records from sql server database table we have firstly create a WCF service and website (to consume the WCF service).

Sunday, August 16, 2015

WCF tutorial: Create and Consume WCF Service using visual studio 2013

How to insert record into Sql Server database using WCF service

In this tutorial I am going to explain how to insert record into Sql Server database using WCF service

Description:

We have to perform task to insert the record into Sql Server database :
Create Database and table
Create a WCF service
Create a Web application (Website) to consume the WCF service

Implementation:
I have created a Table Movie:

How to insert record into Sql Server database using WCF service
Create a store procedure to insert record in database table

Create PROCEDURE Sp_InsertMovieDetail
(
@name varchar(100),
@genre varchar(100),
@cost int,
@poster varchar(max)
)
AS
BEGIN
            SET NOCOUNT ON;
Insert into Movie(Name,Genre,Cost,Poster) values(@name,@genre,@cost,@poster)

END

Saturday, August 15, 2015

WCF services VS Web services in Asp.net

In this article I am going to differentiate the WCF service and web service.

In the previous article I have explained Introduction to WCF.


Web service
WCF service
Web service is available in the namespace System.Web.Services.Webservices
WCF service is available in the namespace System.ServiceModel
It is hosted only in IIS.
WCF is hosted in IIS, WAS (Window activation service), self hosting and managed window service.
It is supported only HTTP and HTTPS protocol.
It supports various protocol i.e.  HTTP, HTTPS, WS-HTTP, TCP/IP and MSMQ.
Web services have .asmx extension.
WCF services have .svc extension.
[webservice] and [webmethod] attributes are used to define the web service.
[ServiceContract] and [OperationContract] attributes are used to define the WCF service.
It is support security but less secure as compare to WCF services.
WCF supports security, reliable messaging and transaction. It is more secure compare to web services.
It supports one way and request-response service operations.
It supports the one way, two way (duplex) and request-response operations.
It is used for XML serializer.
It is used for DataContarct serializer.
In web services hash table cannot be serialized.
In WCF hash table can be serialized.
Performance wise web services are slow.
WCF is faster than web services.
It doesn’t support multithreading.
It supports the multi threading by using ServiceBehaviour class.
It supports XML and MTOM (Message transmission optimization Mechanism)
It supports XML, MTOM (Message transmission optimization Mechanism) and binary message encoding.
Unhandled exceptions are returned to the client as SOAP faults.
Unhandled exceptions are not return to the client as SOAP faults. WCF support better exception handling by using fault contract.

In this article we have know the difference between WCF service and Web serviceI hope you enjoyed this article.

Thursday, August 13, 2015

WCF: Introduction to Window communication foundation (WCF) in Asp.net

WCF stands for windows communication foundation and was first released as part of .NET Framework 3.0.  It is a set of application programming interface (API) and used to implement and deploy service oriented application. WCF supports multiple bindings like HTTP, HTTPS, TCP/IP, MSMQ and PIPE. WCF provide better reliability and security as compared to web services. WCF going to covers the web services.

Advantages on WCF:-
 1). WCF is faster than web services.
 2). WCF has support for various protocols like HTTP, HTTPS, TCP/IP, MSMQ, and PIPE.
 3). We can host the WCF on IIS, WAS, self hosting and window service.
 4). WCF provide better reliability and security as compared to web services.
 5). WCF provide the integrated logging mechanism which can be used by enabling the trace mechanism from configuration file.
 6). WCF support better exception handling using a fault contract. 

Tuesday, August 11, 2015

Implement Google style pagination in Repeater control in asp.net

Introduction: In this article I am going to explain how to Implement Google Style Pagination in Repeater Control in Asp.net

Description:
In this example I am using the Next, Previous, First and last button in pagination. I have created table Student_Detail and table have data.

As we know repeater control by default does not have pagination option. Hence if we use the repeater control and want pagination in it so we have to write the custom code for it.

Thursday, August 6, 2015

Asp.net: Display Binary format image in Gridview Control using C#, VB

In this article today I am going to explain How to display the binary formatted image in Gridview control using asp.net (C#, VB)

Description:

In database, I have a table Movie in which poster of movie stored in Binary format. In this tutorial I am going to display the binary formatted in Gridview using ImageHandler.

Asp.net: Display Binary format image in Gridview Control using C#, VB

Implementation:
Add two webform to project/website. One webform will be used to display the image in Gridview and second one used as ImageHandler.

Wednesday, August 5, 2015

Asp.net: Save image in Binary format in Sql Server Database using C#, VB.net

In this tutorial I am going to explain how to save image in Binary format in Sql Server Database using C#, VB.net

Description:
In the previous article I have explained Insert record into Database using Gridview inAsp.net.

I have created table Movie to store the information of movie like name, genre, cost and poster of movie. Movie poster will be stored in binary format.

Implementation:
Create a table Movie

Asp.net:  Save image in Binary format in Sql Server Database using C#, VB.net


Create store procedure to insert data into database table.

Monday, August 3, 2015

Asp.net: add, edit, delete and update record in Gridview control

In this article I am going to explain how to add, edit, delete and update record in Gridview using Asp.net

Description: 
In this article I am going to insert the record into data using Gridview. Edit, delete and update the record on RowCommand event of gridview.

Sunday, August 2, 2015

Insert record into Database using Gridview in Asp.net

In this tutorial I am going to explain how to insert a new record into database using Gridview FooterTemplate in Asp.net

Description:

In this article I am going to use Geidview to insert new record into database. To implement this use the FooterTemplate inside the TemplateField. Put the textbox control inside FooterTemplate and set require field validation on textboxes.
Implementation:
Create a table Student_Detail 
Insert record into Database using Gridview in Asp.net


Drag and drop the gridview control from toolbox to Webform. Set the ShowFooter property of Gridview True.