no it is actually like this i have a table called pending in that i have a row called balance amount.i want to list from that table having balance amount greater than zero and i want to list it in datagrid view
this is my code
provider = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source ="
dataFile = "D:\gulf work\gulfdata.mdb" ' Change it to your Access Database location
connString = provider & dataFile
myConnection.ConnectionString = connString
Dim str As String
str = "SELECT * FROM pending WHERE balance > 0"
Dim cmd As OleDbCommand = New OleDbCommand(str, myConnection)
dr = cmd.ExecuteReader
DataGridView1.DataSource = dr.Read()
Sorry, I did reply before you posted your code so I have removed that statement.
Looking at the code that you have posted you are using a DataReader to bind to the DataGridView. This is not correct. A DataReader is used as a means to read data in a forward only fashion, not as a collection of data. Instead, use a DataTable or DataSet (which is a collection of DataTables).
Using adapter As New OleDbDataAdapter(str, connString)
Dim table As New DataTable
'Bind the Table to the DataSource of the DataGridView
DataGridView1.DataSource = table