Dim cmd As OleDbCommand = Nothing
                        Dim smd_search As String = "select * from Old_info where UG_PG='BSc'"
                        Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\Bavu's\project\vb files\dms\SPA_Database.accdb")
                        Dim myDa As OleDbDataAdapter
                        Dim mydataset As DataSet

                        cmd = New OleDbCommand(smd_search, con)
                        myDa = New OleDbDataAdapter(cmd)
                        mydataset = New DataSet()
                        Try
                            If con.State = ConnectionState.Closed Then
                                con.Open()
                                myDa.Fill(mydataset, "Old_info")
                                search_data_DataGridView.DataSource = mydataset.Tables("Old_inf0").DefaultView


                            End If
                        Catch ex As Exception
                            MsgBox(ex.Message)
                        End Try


            `Inline Code Example Here`

For one thing,

myDa.Fill(mydataset, "Old_info")

and

search_data_DataGridView.DataSource = mydataset.Tables("Old_inf0").DefaultView

Are refrencing two different tables.

You have a zero placed at the end of

search_data_DataGridView.DataSource = mydataset.Tables("Old_inf0").DefaultView

Comments
Good catch
This article has been dead for over six months. Start a new discussion instead.