hi guys,
i have the following code,

VB Code:
  1. Imports System.Data
  2. Imports System.Data.OleDb
  3. Public Class Form1
  4.     Dim objconnection As OleDbConnection
  5.     Dim datagridview1 As New DataGridView
  6.  
  7.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  8.  
  9.         Dim form2 As New Form2
  10.  
  11.         form2.Show()
  12.  
  13.         objconnection = New OleDbConnection( _
  14.                         "provider=microsoft.jet.oledb.4.0;" & _
  15.                         "data source =" & TextBox1.Text & ";")
  16.         Try
  17.             objconnection.Open()
  18.         Catch oledbexceptionerr As OleDbException
  19.             Debug.WriteLine(oledbexceptionerr.Message)
  20.         Catch invalidoperationerr As InvalidOperationException
  21.             Debug.WriteLine(invalidoperationerr.Message)
  22.         End Try
  23.         Dim objcommand As New OleDbCommand("SELECT * from Products", objconnection)
  24.         Dim objDataAdapter As New OleDbDataAdapter
  25.         Dim objDataTable As New DataTable
  26.         objDataAdapter.SelectCommand = objcommand
  27.         Dim dataset As New DataSet
  28.         Try
  29.             objDataAdapter.Fill(objDataTable)
  30.  
  31.             datagridview1.DataSource = objDataTable
  32.  
  33.             datagridview1.AlternatingRowsDefaultCellStyle.BackColor = Color.WhiteSmoke
  34.  
  35.             datagridview1.CellBorderStyle = DataGridViewCellBorderStyle.None
  36.  
  37.             datagridview1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
  38.  
  39.         Catch OleDbExceptionErr As OleDbException
  40.             MessageBox.Show(OleDbExceptionErr.Message)
  41.         End Try
  42.  
  43.         objcommand.Dispose()
  44.         objcommand = Nothing
  45.         objDataAdapter.Dispose()
  46.         objDataAdapter = Nothing
  47.         objDataTable.Dispose()
  48.         objDataTable = Nothing
  49.     End Sub
  50.  
  51.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  52.  
  53.         Dim ofd As New OpenFileDialog
  54.  
  55.         With ofd
  56.  
  57.             .Filter = "mdb|*.mdb"
  58.  
  59.             .FilterIndex = 1
  60.  
  61.             .Title = "opendatabase"
  62.  
  63.         End With
  64.  
  65.         If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
  66.  
  67.             TextBox1.Text = ofd.FileName
  68.  
  69.         End If
  70.  
  71.     End Sub
  72. End Class


I have 2 buttons and a textbox in first form and in other form i have a datagrid. i need to show the database in datagrid when i click the button. i tried with the above code but nothing is being displayed in the datagrid.