honeypot Posted March 17, 2004 Posted March 17, 2004 Hi :) I have a windows form which contains a datagrid and a textbox, the textbox being where users are to enter a name to search in the datagrid. Ive never used datagrids/datalists before and it doesn't appear to be working properly i.e. i type in a name that i know exists in the database but nothing is returned. Perhaps someone can tell me where i'm going wrong and point me in the right direction? Here is my code: Private Sub txtChooseName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtChooseName.TextChanged Dim ds As New DataSet5 Dim dt As DataTable = ds.Tables.Add("Search") Dim dv As DataView = ds.Tables("Postbook").DefaultView DataGrid1.DataSource = ds.DefaultViewManager dv.RowFilter = "[Name] Like '" & txtChooseName.Text & "%'" End Sub Quote
techmanbd Posted March 17, 2004 Posted March 17, 2004 Need another % like so dv.RowFilter = "[Name] Like '%" & txtChooseName.Text & "%'" Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
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.