Filter filenames in temp table

Xancholy

Well-known member
Joined
Aug 29, 2006
Messages
143
Programming Experience
Beginner
I need to read filenames within a specific directory into a temp table.

When user types into search textbox1, the filtered filelist needs to be displayed in a listbox/datagridview.

I know this must be child's play for most of you, but please can you show me how to code this scenario ?

Thanks
 
Last edited:
make a typed dataset, one datatable, one column called: filename
from the datasources window, drop a grid rendition of it on the form
Also drop a button and a textbox
in code:

VB.NET:
For Each s as String in Directory.GetFiles("C:\")
  myDataSet.MyDataTable.AddMyDataTableRow(s)
Next s

Then:
VB.NET:
Sub Whatever(whatever) Handles Button1.Click
  MyGridBindingSource.Filter = String.Format( "[FileName] LIKE '%{0}%'", textbox1.Text)
End Sub
 

Latest posts

Back
Top