Sunday, April 27, 2014

Visual Basic .NET Tutorial 53 -How to import excel file to datagridview ...

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim dataSet As System.Data.DataSet
            Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
            Dim path As String = "C:\\Users\\dwishika\\Desktop\\vids\\excel\\Book1.xlsx"

            MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;")
            MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)

            dataSet = New System.Data.DataSet
            DataGridView1.DataSource = dataSet.Tables(0)

        Catch ex As Exception
        End Try

    End Sub
End Class


Importing Any Excel Spreadsheet into a DataGridView - C#
VB.NET - Importing Excel File to dataGridView
import Excel File to DataGridView
Import Excel To DatagridView
Import Data from Excel to DataGridView in VB.NET
import from excel to datagridview
VB.NET DataGridView Loading data from Excel
importing excel file into datagridview  How to get data from excel sheet to datagridview in VB.NET importing RowName and ColumnName from an excelfile posts
Import Excel file to DataGridView‎ VB.NET
Saving DataGrid View to Excel and opening Excel to
How to import data from Excel to Datagrid‎
How to Export Datagridview contents to Excel - VB.NET
IT Certification Category (English)640x480

Partner Sites

Top Online Courses From ProgrammingKnowledge

Python Course
Java Course
Bash Course
Linux Course
C Course
C++ Course
PHP Course
Android Course
C# Course
JavaFx Course
NodeJs Course
Jenkins Course
Scala Course
Bootstrap Course
MongoDB Course
QT C++ GUI Course