Click here to Skip to main content
16,016,345 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How can I do filtering name or a character, for example,
Proxy that works already
Socks is already working
I want to type Proxy automatically displays Table
Posted
Updated 20-Mar-14 4:56am
v3
Comments
OriginalGriff 20-Mar-14 11:30am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

VB
Public Class Form12
    Public oCn As New System.Data.SqlClient.SqlConnection("Data Source=(local);Initial Catalog=MyDatabase;Uid=sa")
    Dim dv As New DataView

    Private Sub Form12_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        fill_grid()
    End Sub

    Sub fill_grid()
        If oCn.State = ConnectionState.Closed Then
            oCn.Open()
        End If
        Me.DataGridView1.Rows.Clear()
        Dim cmd As New SqlClient.SqlCommand("SELECT * from mst_scheme where scheme_name like '" & Me.TextBox1.Text & "%'", oCn)
        Dim da As New SqlClient.SqlDataAdapter(cmd)
        Dim ds As New DataSet("bpl")
        Dim i As Integer = 0

        da.Fill(ds, "bpl")

        If ds.Tables(0).Rows.Count > 0 Then
            While (i <> ds.Tables(0).Rows.Count)
                Me.DataGridView1.Rows.Add()
                Me.DataGridView1.Item(0, i).Value = i + 1
                Me.DataGridView1.Item(1, i).Value = ds.Tables(0).Rows(i).Item("scheme_name").ToString
                Me.DataGridView1.Item(2, i).Value = ds.Tables(0).Rows(i).Item("scheme_id").ToString
                i = i + 1
            End While
        End If

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        fill_grid()
    End Sub
End Class
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900