the code seems to be fine dont know why its not working.
when i execute the same sql directly in database it works fine.

the error is get is oledbexception was unhandled syntax error in from clause. please help me thanks is advance.

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim connection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\abrar\My Documents\Database2.mdb")
        Dim sql As String = "SELECT * FROM Transaction where Due_Date > RentedDate + 30 "
        Dim command As New OleDbCommand(sql, connection)

        Catch ex As InvalidOperationException
        End Try

        Dim overDueDVDadapter As New OleDbDataAdapter(command)
        Dim overDueDVD As New DataSet


        overDueDVDadapter.Fill(overDueDVD, "Transaction")

        reportDataGridView.DataSource = overDueDVD.Tables("Transaction").DefaultView

        If connection.State <> ConnectionState.Closed Then
        End If

    End Sub

"Transaction" is a reserved word. Rename your table to "TransactionTable" or something like that.

This question has already been answered. Start a new discussion instead.