Importing data from excel to gridview

This code snippet describes about how we can import the data from an excel sheet into gridview. using the Microsoft.Jet.OLEDB.4.0 managed provider we are going to import the data from the excel sheet. We are going to retrieve the data from the excel worksheet and populate the data in the dataset using a dataadapter. Then we are going to bind the data of the dataset to the gridview.

This code snippet describes about how we can import the data from an excel sheet into gridview. Please import the following namespaces.