Jump to content
Xtreme .Net Talk

honeypot

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by honeypot

  1. 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
  2. hi there :) i have a windows form, that has a txtSearchName, txtSearchDate and txtSearchOfficer - and a datagrid (which at the moment displays all records of database). What i'd like to achieve is for the user to enter eg. smith in the txtSearchName box and for the datagrid to return all records containing the name smith in the "name" field. I need help desperately with the coding. All sql connections, adapters and dataset are in place. Not sure how to code the txtSearchName box etc. Any help would be much appreciated. Thank you.
×
×
  • Create New...