Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reload the Datagridview using DataView RowFilter?
Message
From
06/01/2011 03:07:35
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01494873
Message ID:
01494882
Views:
32
yes ar, thx your reply first.......i need loop the user entry to search dv1.RowFilter = "brand like '" + txtFinder.Text + "%'"
Else if , the user is clear the search text box , to do my else code, in my else part, i only want show all the data , but in one time is ok,
but after i do not understand can't to show all the data?


 Private Sub txtFinder_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFinder.TextChanged
        Dim str As String
        Dim findIndex As String
   
            If txtFinder.Text <> "" Then
                dv1.RowFilter = "brand like '" + txtFinder.Text + "%'"
            Else                                                                                 'Question in here begin, and my statement has some problem ?
                connection()
                cn.Open()
                Dim qs As String = "select brand , descr from brand"

                da = New SqlDataAdapter(qs, cn)
                da.MissingSchemaAction = MissingSchemaAction.AddWithKey
                da.Fill(ds, "Brand")
                dv1 = ds.Tables("Brand").DefaultView
                Me.BrandBindingSource.DataSource = ds.Tables("Brand")
                Me.Dg.DataSource = Me.BrandBindingSource


        End If
End sub
Previous
Reply
Map
View

Click here to load this message in the networking platform