Results 1 to 13 of 13

Thread: [Solved] Filtering datagridview with textbox

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2014
    Posts
    21

    [Solved] Filtering datagridview with textbox

    I am using this code to import an excel sheet into the datagridview

    Code:
            
            Dim dt As DataTable = New DataTable
            dt.Columns.Add(New DataColumn("PartNumber"))
            bs = New BindingSource
            bs.DataSource = dt
            DataGridView1.DataSource = bs
            Dim DtSet As System.Data.DataSet
            Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
            Con = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\ExcelWork.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES""")
            MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", Con)
            MyCommand.TableMappings.Add("Table", "Net-informations.com")
            DtSet = New System.Data.DataSet
            MyCommand.Fill(DtSet)
            DataGridView1.DataSource = DtSet.Tables(0)
            Con.Close()
    Now how do I filter it using a text box????
    Last edited by 1635321; Jul 7th, 2014 at 10:16 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width