I am not able to display dataset. Can anyone help me out?
Here is my code:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Windows.Forms
Imports System.Data.OleDb
Public Class Form3
Inherits System.Windows.Forms.Form
Private WithEvents DataGridView1 As New DataGridView
Private Sub Currdbbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Currdbbtn.Click
Dim objConnection As New OleDb.OleDbConnection
objConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:\Documents and settings\ambarda\My Documents\Sampledatabase.mdb;"
Dim ds As New DataSet
Dim sql As String = "SELECT * FROM Sheet1"
Dim objDataAdapter As New OleDb.OleDbDataAdapter(sql, objConnection)
objDataAdapter.Fill(ds, "Runsheet Info")
DataGridView1.DataSource = ds.DefaultViewManager
End sub
End class
I am not able to view dataset. Any help and suggestions appreciated.
Thanks in advance.
Aditya