shannanl Posted December 28, 2005 Posted December 28, 2005 I am new to ado.net. I have a dataset that I am using to populate a datagridview. Under the grid I have a text box and I want the user to be able to filter the datagrid based on what they type in the box. As an example, if the user types an "A" then all people listed in the grid with the last name of "A" will show up. If they type "AB", only people starting with "AB" will show up. I use the WHERE LIKE '" & textbox1.text & "%' as my query. I don't want to have to requery the db each time. I understand that this can be done with the dataset but I don't know how. Any help would be greatly appreciated. Shannan Quote
Denaes Posted December 28, 2005 Posted December 28, 2005 The DataGridView has a Filter parameter that you can use many SQL filtering statements. like "Name = 'a'" or as you would do it using VB.net (C# uses a plus sign instead of amperstand): dgv.filter = "Name '" & textbox.text & "'" dgv.refresh or something very similar to that. Lookup the Filter method in MSDN and they have an example of how it works. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.