Hie
I have a text box and search button, when I search for a record I get the correct record the first time, but when I search again I get results from my first search and second search. If i keep searching the results keep accumulating instead of populating the datagrid with only the current search results. How do i go about populating the datagrid with only the current search results.
my is as follows
Private Sub cmdSearch_Click(sender As Object, e As EventArgs) Handles cmdSearch.Click
provider = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source ="
dataFile = "C:\Users\SaNonozaa\Documents\Installations.accdb"
connString = provider & dataFile
If myConnection.State = ConnectionState.Closed Then
myConnection.ConnectionString = connString
myConnection.Open()
End If
Dim dt As New DataTable
Dim adp As New OleDb.OleDbDataAdapter("SELECT * FROM Computers WHERE [BrandCPU]= '" & txtSearch.Text & "' ", myConnection)
adp.Fill(dts, "View_Database")
dt = dts.Tables("View_Database")
Dim dv As New DataView(dts.Tables("View_Database"))
dv.Sort = "BrandCPU"
EquipDataGrid.DataSource = dv
myConnection.Close()
End Sub