Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...